Package com.io7m.smfj.core
Class SMFAttributeName
- java.lang.Object
-
- com.io7m.smfj.core.SMFAttributeName
-
- All Implemented Interfaces:
SMFAttributeNameType,java.lang.Comparable<SMFAttributeNameType>
public final class SMFAttributeName extends java.lang.Object implements SMFAttributeNameType
An attribute name.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSMFAttributeName.BuilderBuilds instances of typeSMFAttributeName.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFAttributeName.Builderbuilder()Creates a builder forSMFAttributeName.static SMFAttributeNamecopyOf(SMFAttributeNameType instance)Creates an immutable copy of aSMFAttributeNameTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofSMFAttributeNamethat have equal attribute values.inthashCode()Computes a hash code from attributes:value.static SMFAttributeNameof(java.lang.String value)Construct a new immutableSMFAttributeNameinstance.java.lang.StringtoString()Prints the immutable valueSMFAttributeNamewith attribute values.java.lang.Stringvalue()SMFAttributeNamewithValue(java.lang.String value)Copy the current immutable object by setting a value for thevalueattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.smfj.core.SMFAttributeNameType
checkPreconditions, compareTo
-
-
-
-
Method Detail
-
value
public java.lang.String value()
- Specified by:
valuein interfaceSMFAttributeNameType- Returns:
- The actual name value
-
withValue
public final SMFAttributeName withValue(java.lang.String value)
Copy the current immutable object by setting a value for thevalueattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofSMFAttributeNamethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:value.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSMFAttributeNamewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static SMFAttributeName of(java.lang.String value)
Construct a new immutableSMFAttributeNameinstance.- Parameters:
value- The value for thevalueattribute- Returns:
- An immutable SMFAttributeName instance
-
copyOf
public static SMFAttributeName copyOf(SMFAttributeNameType instance)
Creates an immutable copy of aSMFAttributeNameTypevalue. 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 SMFAttributeName instance
-
builder
public static SMFAttributeName.Builder builder()
Creates a builder forSMFAttributeName.SMFAttributeName.builder() .setValue(String) // requiredvalue.build();- Returns:
- A new SMFAttributeName builder
-
-