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
EntrySource of the entry. |
private AddeEntry.EntryStatus |
entryStatus
Optional
EntryStatus of the entry. |
private AddeEntry.EntryType |
entryType
Optional
EntryType of the entry. |
private AddeEntry.EntryValidity |
entryValidity
Optional
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
EntryType
of the entry. Defaults to
EntryType#UNKNOWN
.private AddeEntry.EntryValidity entryValidity
EntryValidity
of the entry. Defaults to
EntryValidity#UNVERIFIED
.private AddeEntry.EntrySource entrySource
EntrySource
of the entry. Defaults to
EntrySource#SYSTEM
.private AddeEntry.EntryStatus entryStatus
EntryStatus
of the entry. Defaults to
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(String, String)
public RemoteAddeEntry.Builder type(AddeEntry.EntryType entryType)
RemoteAddeEntry.entryType
. If this method is not
called, entryType
will default to 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
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
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
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
.