public static class RemoteAddeEntry.Builder extends Object
RemoteAddeEntry
in a readable way, despite there being
multiple final
fields.
The only required parameters are
the RemoteAddeEntry.address
and RemoteAddeEntry.group
.
Some examples:
RemoteAddeEntry e = RemoteAddeEntry.Builder("adde.cool.com", "RTIMAGES").build(); e = RemoteAddeEntry.Builder("adde.cool.com", "RTIMAGES").type(EntryType.IMAGE).account("user", "1337").build(); e = RemoteAddeEntry.Builder("adde.cool.com", "RTIMAGES").account("user", "1337").type(EntryType.IMAGE).build() e = RemoteAddeEntry.Builder("a.c.com", "RTIMGS").validity(EntryValidity.VERIFIED).build();
Modifier and Type | Field and Description |
---|---|
private AddeAccount |
account
Optional
AddeAccount of the entry. |
private String |
address |
private String |
description
Optional description of the entry.
|
private AddeEntry.EntrySource |
entrySource
Optional
AddeEntry.EntrySource of the entry. |
private AddeEntry.EntryStatus |
entryStatus
Optional
AddeEntry.EntryStatus of the entry. |
private AddeEntry.EntryType |
entryType
Optional
AddeEntry.EntryType of the entry. |
private AddeEntry.EntryValidity |
entryValidity
Optional
AddeEntry.EntryValidity of the entry. |
private String |
group |
Constructor and Description |
---|
RemoteAddeEntry.Builder(String address,
String group)
Creates a new "builder" for an ADDE entry.
|
Modifier and Type | Method and Description |
---|---|
RemoteAddeEntry.Builder |
account(String username,
String project)
Optional "parameter" for an ADDE entry.
|
RemoteAddeEntry |
build()
Creates an entry based upon the values supplied to the other
methods.
|
RemoteAddeEntry.Builder |
invalidate() |
RemoteAddeEntry.Builder |
source(AddeEntry.EntrySource entrySource)
Optional "parameter" for an ADDE entry.
|
RemoteAddeEntry.Builder |
status(AddeEntry.EntryStatus entryStatus)
Optional "parameter" for an ADDE entry.
|
RemoteAddeEntry.Builder |
type(AddeEntry.EntryType entryType)
Optional "parameter" for an ADDE entry.
|
RemoteAddeEntry.Builder |
validity(AddeEntry.EntryValidity entryValidity)
Optional "parameter" for an ADDE entry.
|
private AddeEntry.EntryType entryType
AddeEntry.EntryType
of the entry. Defaults to
AddeEntry.EntryType.UNKNOWN
.private AddeEntry.EntryValidity entryValidity
AddeEntry.EntryValidity
of the entry. Defaults to
AddeEntry.EntryValidity.UNVERIFIED
.private AddeEntry.EntrySource entrySource
AddeEntry.EntrySource
of the entry. Defaults to
AddeEntry.EntrySource.SYSTEM
.private AddeEntry.EntryStatus entryStatus
AddeEntry.EntryStatus
of the entry. Defaults to
AddeEntry.EntryStatus.ENABLED
.private AddeAccount account
AddeAccount
of the entry. Defaults to
AddeEntry.DEFAULT_ACCOUNT
.private String description
public RemoteAddeEntry.Builder(String address, String group)
address
- Address of the ADDE entry. Cannot be null.group
- Group of the ADDE entry. Cannot be null.NullPointerException
- if either address
or
group
is null
.public RemoteAddeEntry.Builder account(String username, String project)
AddeEntry.DEFAULT_ACCOUNT
.username
- Username of the ADDE account. Cannot be
null
.project
- Project number for the ADDE account. Cannot be
null
.AddeAccount.AddeAccount(String, String)
public RemoteAddeEntry.Builder type(AddeEntry.EntryType entryType)
RemoteAddeEntry.entryType
. If this method is not
called, entryType
will default to AddeEntry.EntryType.UNKNOWN
.entryType
- ADDE entry "type".public RemoteAddeEntry.Builder validity(AddeEntry.EntryValidity entryValidity)
RemoteAddeEntry.entryValidity
. If this method is
not called, entryValidity
will default to
AddeEntry.EntryValidity.UNVERIFIED
.entryValidity
- ADDE entry "validity".public RemoteAddeEntry.Builder source(AddeEntry.EntrySource entrySource)
RemoteAddeEntry.entrySource
. If this method is not
called, entrySource
will default to
AddeEntry.EntrySource.SYSTEM
.entrySource
- ADDE entry "source".public RemoteAddeEntry.Builder status(AddeEntry.EntryStatus entryStatus)
RemoteAddeEntry.entryStatus
. If this method is not
called, entryStatus
will default to
AddeEntry.EntryStatus.ENABLED
.entryStatus
- ADDE entry "status".public RemoteAddeEntry.Builder invalidate()
public RemoteAddeEntry build()