Class ImmutableSPFElement

  • All Implemented Interfaces:
    SPFElement

    @Generated("org.immutables.processor.ProxyProcessor")
    public final class ImmutableSPFElement
    extends Object
    implements SPFElement
    Immutable implementation of SPFElement.

    Use the builder to create immutable instances: ImmutableSPFElement.builder().

    • Method Detail

      • getValue

        public String getValue()
        Specified by:
        getValue in interface SPFElement
        Returns:
        The value of the value attribute
      • withQualifier

        public final ImmutableSPFElement withQualifier​(SPFQualifier value)
        Copy the current immutable object by setting a value for the qualifier attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for qualifier
        Returns:
        A modified copy of the this object
      • withValue

        public final ImmutableSPFElement withValue​(String value)
        Copy the current immutable object by setting a value for the value attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for value
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(Object another)
        This instance is equal to all instances of ImmutableSPFElement that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: qualifier, value.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value SPFElement with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableSPFElement copyOf​(SPFElement instance)
        Creates an immutable copy of a SPFElement value. 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 for ImmutableSPFElement.
         ImmutableSPFElement.builder()
            .qualifier(net.rpcnet.securitytoolkit.mail.spf.SPFQualifier) // required qualifier
            .value(String) // required value
            .build();
         
        Returns:
        A new ImmutableSPFElement builder