Package org.xrpl.xrpl4j.codec.binary
Class ImmutableFieldHeader.Builder
java.lang.Object
org.xrpl.xrpl4j.codec.binary.ImmutableFieldHeader.Builder
- Enclosing class:
ImmutableFieldHeader
Builds instances of type
ImmutableFieldHeader.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableFieldHeader.fieldCode(int fieldCode) Initializes the value for thefieldCodeattribute.from(FieldHeader instance) Fill a builder with attribute values from the providedFieldHeaderinstance.typeCode(int typeCode) Initializes the value for thetypeCodeattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedFieldHeaderinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
fieldCode
Initializes the value for thefieldCodeattribute.- Parameters:
fieldCode- The value for fieldCode- Returns:
thisbuilder for use in a chained invocation
-
typeCode
Initializes the value for thetypeCodeattribute.- Parameters:
typeCode- The value for typeCode- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableFieldHeader.- Returns:
- An immutable instance of FieldHeader
- Throws:
IllegalStateException- if any required attributes are missing
-