public class PredefinedIdent extends Object implements IdentValue
This class contains the value and the encoded representations for a single ident.
This class is immutable.
Constructor and Description |
---|
PredefinedIdent(String ident,
String value,
EncodingConfig encoding,
Set<EncodingConfig> encodings)
Create a new
PredefinedIdent and the value for the ident . |
Modifier and Type | Method and Description |
---|---|
String |
getEncoded(EncodingConfig encoding)
Return the random number in the given
encoding . |
String |
getIdent()
Return the ident number.
|
byte[] |
getValue()
Return the raw random number generated.
|
public PredefinedIdent(String ident, String value, EncodingConfig encoding, Set<EncodingConfig> encodings)
Create a new PredefinedIdent
and the value for the ident
. The value will be encoded in all given
encodings
.
ident
- the ident for which the random number will be generated for.value
- the value of the ident.encoding
- the encoding of the given value.encodings
- the encodings that are used for the encoded representation of the random number.IllegalArgumentException
- if no encoder for a given encoding can be found.public String getIdent()
Return the ident number.
getIdent
in interface IdentValue
public byte[] getValue()
Return the raw random number generated.
getValue
in interface IdentValue
public String getEncoded(EncodingConfig encoding)
Return the random number in the given encoding
. Only the encodings that were given during construction
can be returned.
getEncoded
in interface IdentValue
encoding
- the encoding for which the encoded value should be returned.null
if the encoding is unknown.Copyright © 2020 sw4j.org. All rights reserved.