public static class RemoteAddeEntry.Builder extends java.lang.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 java.lang.String |
address
Hostname or IP of the resulting entry.
|
private java.lang.String |
alias
Optional alias for the entry.
|
private java.lang.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 java.lang.String |
group
ADDE group to use for the resulting entry.
|
private boolean |
temporary
Optional flag for whether or not the entry is temporary.
|
Constructor and Description |
---|
Builder(java.lang.String address,
java.lang.String group)
Creates a new "builder" for an ADDE entry.
|
Modifier and Type | Method and Description |
---|---|
RemoteAddeEntry.Builder |
account(java.lang.String username,
java.lang.String project)
Optional "parameter" for an ADDE entry.
|
RemoteAddeEntry.Builder |
alias(java.lang.String alias)
Optionally sets the "alias" that can be used to refer to
the resulting entry.
|
RemoteAddeEntry |
build()
Creates an entry based upon the values supplied to the other
methods.
|
RemoteAddeEntry.Builder |
invalidate()
Convenient way to generate a new, invalid entry.
|
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 |
temporary(boolean temporary)
Optionally control whether or not the resulting entry is
"temporary".
|
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 final java.lang.String address
private final java.lang.String group
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 java.lang.String description
private boolean temporary
false
.private java.lang.String alias
public Builder(java.lang.String address, java.lang.String group)
address
- Address of the ADDE entry. Cannot be null.group
- Group of the ADDE entry. Cannot be null.java.lang.NullPointerException
- if either address
or
group
is null
.public RemoteAddeEntry.Builder account(java.lang.String username, java.lang.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.Builder temporary(boolean temporary)
temporary
- Whether or not the entry is temporary.public RemoteAddeEntry.Builder alias(java.lang.String alias)
alias
- Alias for the resulting entry.public RemoteAddeEntry build()
RemoteAddeEntry
.