Class ImmutableSPFElement
- java.lang.Object
-
- net.rpcnet.securitytoolkit.mail.spf.ImmutableSPFElement
-
- All Implemented Interfaces:
SPFElement
@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableSPFElement extends Object implements SPFElement
Immutable implementation ofSPFElement.Use the builder to create immutable instances:
ImmutableSPFElement.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableSPFElement.BuilderBuilds instances of typeImmutableSPFElement.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableSPFElement.Builderbuilder()Creates a builder forImmutableSPFElement.static ImmutableSPFElementcopyOf(SPFElement instance)Creates an immutable copy of aSPFElementvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableSPFElementthat have equal attribute values.SPFQualifiergetQualifier()StringgetValue()inthashCode()Computes a hash code from attributes:qualifier,value.StringtoString()Prints the immutable valueSPFElementwith attribute values.ImmutableSPFElementwithQualifier(SPFQualifier value)Copy the current immutable object by setting a value for thequalifierattribute.ImmutableSPFElementwithValue(String value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
getQualifier
public SPFQualifier getQualifier()
- Specified by:
getQualifierin interfaceSPFElement- Returns:
- The value of the
qualifierattribute
-
getValue
public String getValue()
- Specified by:
getValuein interfaceSPFElement- Returns:
- The value of the
valueattribute
-
withQualifier
public final ImmutableSPFElement withQualifier(SPFQualifier value)
Copy the current immutable object by setting a value for thequalifierattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for qualifier- Returns:
- A modified copy of the
thisobject
-
withValue
public final ImmutableSPFElement withValue(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(Object another)
This instance is equal to all instances ofImmutableSPFElementthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:qualifier,value.
-
toString
public String toString()
Prints the immutable valueSPFElementwith attribute values.
-
copyOf
public static ImmutableSPFElement copyOf(SPFElement instance)
Creates an immutable copy of aSPFElementvalue. 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 SPFElement instance
-
builder
public static ImmutableSPFElement.Builder builder()
Creates a builder forImmutableSPFElement.ImmutableSPFElement.builder() .qualifier(net.rpcnet.securitytoolkit.mail.spf.SPFQualifier) // requiredqualifier.value(String) // requiredvalue.build();- Returns:
- A new ImmutableSPFElement builder
-
-