Package org.xrpl.xrpl4j.codec.binary
Class ImmutableFieldHeader
java.lang.Object
org.xrpl.xrpl4j.codec.binary.ImmutableFieldHeader
- All Implemented Interfaces:
FieldHeader
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableFieldHeader
extends Object
implements FieldHeader
Immutable implementation of
FieldHeader.
Use the builder to create immutable instances:
ImmutableFieldHeader.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableFieldHeader. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableFieldHeader.Builderbuilder()Creates a builder forImmutableFieldHeader.static ImmutableFieldHeadercopyOf(FieldHeader instance) Creates an immutable copy of aFieldHeadervalue.booleanThis instance is equal to all instances ofImmutableFieldHeaderthat have equal attribute values.intinthashCode()Computes a hash code from attributes:fieldCode,typeCode.toString()Prints the immutable valueFieldHeaderwith attribute values.inttypeCode()final ImmutableFieldHeaderwithFieldCode(int value) Copy the current immutable object by setting a value for thefieldCodeattribute.final ImmutableFieldHeaderwithTypeCode(int value) Copy the current immutable object by setting a value for thetypeCodeattribute.
-
Method Details
-
fieldCode
public int fieldCode()- Specified by:
fieldCodein interfaceFieldHeader- Returns:
- The value of the
fieldCodeattribute
-
typeCode
public int typeCode()- Specified by:
typeCodein interfaceFieldHeader- Returns:
- The value of the
typeCodeattribute
-
withFieldCode
Copy the current immutable object by setting a value for thefieldCodeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fieldCode- Returns:
- A modified copy of the
thisobject
-
withTypeCode
Copy the current immutable object by setting a value for thetypeCodeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for typeCode- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableFieldHeaderthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:fieldCode,typeCode. -
toString
Prints the immutable valueFieldHeaderwith attribute values. -
copyOf
Creates an immutable copy of aFieldHeadervalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable FieldHeader instance
-
builder
Creates a builder forImmutableFieldHeader.ImmutableFieldHeader.builder() .fieldCode(int) // requiredfieldCode.typeCode(int) // requiredtypeCode.build();- Returns:
- A new ImmutableFieldHeader builder
-