public class Serial extends AMetadata<Serial> implements Comparable<Serial>
This data type handles SSRF serial number generation.
Serial is composed of four parts separated by colons (":"). The maximum total length is 29 characters (5+1+4+1+2+1+15).
Format is pattern (S29) with validation type SERIAL
[XSD ERR REGEX] This data item MUST comply to the regular expression: "[A-Z0-9-]{1,5}:\w{0,4}:[A-Z]{2}: \S{1,15}"
Modifier and Type | Field and Description |
---|---|
protected String |
value
The value property.
|
availability, cls, extReferences, idref, legacyReleasability, quality, recommendedValue, remarkRef
Constructor and Description |
---|
Serial(String ssrfSerial)
Construct a new data type instance with the indicated value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Serial o)
Comparison and sorting is alphabetical based upon the String value.
|
boolean |
equals(Object obj)
Equality is based upon the user-configured serial number portion of the
value.
|
static Serial |
getInstance(Class<? extends Common<?>> clazz)
Get a Serial instance for the indicated class instance.
|
String |
getSerial()
Set the serial number Serial identifier component.
|
Long |
getSerialAsNumber()
Set the serial number Serial identifier component.
|
String |
getValue()
Gets the SSRF SERIAL number value.
|
int |
hashCode()
Hash code is based upon the user-configured serial number portion of the
value.
|
boolean |
isSet()
Determine if the required fields in this SSRF data type instance are set.
|
boolean |
isSetValue()
Determine if the Value is configured.
|
void |
postLoad()
Update the serial number to write the component configurations.
|
void |
prepare()
Update the serial number with the component configurations.
|
void |
setCountry(ListCCY country)
Set the Serial number Country part (REQUIRED).
|
void |
setLocale(Locale locale)
Set the Serial number Country part (REQUIRED).
|
void |
setOrganisation(String organisation)
Set the serial number Organization code (OPTIONAL).
|
void |
setSerial(Long number)
Set the serial number Serial identifier as a Long Number instance.
|
void |
setSerial(String serial)
Set the serial number Serial identifier.
|
void |
setValue(String value)
Sets the SSRF SERIAL number value.
|
String |
toString()
Gets the SSRF SERIAL number value.
|
Serial |
withCountry(ListCCY value)
Set the Serial number Country part (REQUIRED).
|
Serial |
withLocale(Locale value)
Set the Serial number Country part (REQUIRED).
|
Serial |
withOrganisation(String value)
Set the serial number Organization code (OPTIONAL).
|
Serial |
withSerial(Long value)
Set the serial number Serial identifier (REQUIRED) as a Long Number
instance.
|
Serial |
withSerial(String value)
Set the serial number Serial identifier (REQUIRED).
|
Serial |
withValue(String value)
Sets the SSRF SERIAL number value.
|
getAvailability, getCls, getExtReferences, getIdref, getLegacyReleasability, getQuality, getRecommendedValue, getRemarkRef, isSetAvailability, isSetCls, isSetExtReferences, isSetIdref, isSetLegacyReleasability, isSetQuality, isSetRecommendedValue, isSetRemarkRef, setAvailability, setCls, setIdref, setLegacyReleasability, setQuality, setRecommendedValue, unsetExtReferences, unsetRemarkRef, withAvailability, withCls, withExtReferences, withExtReferences, withIdref, withLegacyReleasability, withQuality, withRecommendedValue, withRemarkRef, withRemarkRef
protected String value
public Serial(String ssrfSerial) throws IllegalArgumentException
ssrfSerial
- a valid SSRF SERIAL string. Format is pattern (S29) with
validation type SERIAL: "[A-Z0-9-]{1,5}:\w{0,4}:[A-Z]{2}:
\S{1,15}"IllegalArgumentException
- if the value does not conform to the
SERIAL formatpublic static Serial getInstance(Class<? extends Common<?>> clazz)
The local is set to the current system default. The serial is programmatically set to a time-sequenced, UUID-based 15-character snippet. The organisation is left blank and may be set by th user.
clazz
- a SSRF class type that extends CommonIllegalArgumentException
- if the object instance does not extend
Commonpublic void prepare()
This method should typically be called after the serial number fields are configured and (optionally) before exporting an SSRF message.
public void postLoad()
This method should typically be called after the Common is imported from XML.
public void setCountry(ListCCY country)
country
- the data source countrypublic void setLocale(Locale locale)
locale
- the data source countrypublic void setOrganisation(String organisation)
organisation
- public String getSerial()
It contains one to fifteen alphanumeric characters (including spaces and special characters), whose meaning is left at the discretion of each domain manager.
public Long getSerialAsNumber()
It contains one to fifteen alphanumeric characters (including spaces and special characters), whose meaning is left at the discretion of each domain manager.
public void setSerial(String serial)
It contains one to fifteen alphanumeric characters (including spaces and special characters), whose meaning is left at the discretion of each domain manager.
serial
- the serial number Serial identifier.public void setSerial(Long number)
It contains one to fifteen alphanumeric characters (including spaces and special characters), whose meaning is left at the discretion of each domain manager.
Developer note: The maximum number value is 15 digits (1E15). This should accommodate most everyday instances including millisecond time stamps (12 digits).
number
- the serial number Serial identifier as an unsigned number up
to 1E15.public String getValue()
Calls format()
first to ensure the returned value reflects the
most recent changes to the serial components.
public void setValue(String value)
If the input value is not null this method attempts to parse the serial number into its component parts and set the internal fields accordingly.
value
- a valid SSRF SERIAL string. Format is pattern (S29) with
validation type SERIAL: "[A-Z0-9-]{1,5}:\w{0,4}:[A-Z]{2}:
\S{1,15}"IllegalArgumentException
- if the value does not conform to the
SERIAL formatpublic boolean isSetValue()
public Serial withValue(String value)
value
- a valid SSRF SERIAL string. Format is pattern (S29) with
validation type SERIAL: "[A-Z0-9-]{1,5}:\w{0,4}:[A-Z]{2}:
\S{1,15}"public Serial withCountry(ListCCY value)
Format is S5
value
- the data source countrypublic Serial withLocale(Locale value)
Format is S5
value
- the data source countrypublic Serial withOrganisation(String value)
Format is S4
value
- the serial number Organizationpublic Serial withSerial(String value)
Format is S15
value
- the serial number Serial identifierIllegalArgumentException
- if the input value is too long (> 15
characters)public Serial withSerial(Long value)
value
- the serial number Serial identifierpublic boolean isSet()
Note that this method only checks for the presence of required information; this method does not validate the information format.
public String toString()
Calls format()
first to ensure the returned value reflects the
most recent changes to the serial components.
This is a shortcut to getValue()
.
public int hashCode()
public boolean equals(Object obj)
public int compareTo(Serial o)
compareTo
in interface Comparable<Serial>
o
- the other TString valueCopyright © 2016 OpenSSRF.org. All rights reserved.