Class SMFSchemaAttribute

    • Method Detail

      • withName

        public final SMFSchemaAttribute withName​(SMFAttributeName value)
        Copy the current immutable object by setting a value for the name attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for name
        Returns:
        A modified copy of the this object
      • withRequiredComponentType

        public final SMFSchemaAttribute withRequiredComponentType​(SMFComponentType value)
        Copy the current immutable object by setting a present value for the optional requiredComponentType attribute.
        Parameters:
        value - The value for requiredComponentType
        Returns:
        A modified copy of this object
      • withRequiredComponentType

        public final SMFSchemaAttribute withRequiredComponentType​(java.util.Optional<? extends SMFComponentType> optional)
        Copy the current immutable object by setting an optional value for the requiredComponentType attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for requiredComponentType
        Returns:
        A modified copy of this object
      • withRequiredComponentCount

        public final SMFSchemaAttribute withRequiredComponentCount​(int value)
        Copy the current immutable object by setting a present value for the optional requiredComponentCount attribute.
        Parameters:
        value - The value for requiredComponentCount
        Returns:
        A modified copy of this object
      • withRequiredComponentCount

        public final SMFSchemaAttribute withRequiredComponentCount​(java.util.OptionalInt optional)
        Copy the current immutable object by setting an optional value for the requiredComponentCount attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for requiredComponentCount
        Returns:
        A modified copy of this object
      • withRequiredComponentSize

        public final SMFSchemaAttribute withRequiredComponentSize​(int value)
        Copy the current immutable object by setting a present value for the optional requiredComponentSize attribute.
        Parameters:
        value - The value for requiredComponentSize
        Returns:
        A modified copy of this object
      • withRequiredComponentSize

        public final SMFSchemaAttribute withRequiredComponentSize​(java.util.OptionalInt optional)
        Copy the current immutable object by setting an optional value for the requiredComponentSize attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for requiredComponentSize
        Returns:
        A modified copy of this object
      • equals

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

        public int hashCode()
        Computes a hash code from attributes: name, requiredComponentType, requiredComponentCount, requiredComponentSize.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static SMFSchemaAttribute of​(SMFAttributeName name,
                                            java.util.Optional<? extends SMFComponentType> requiredComponentType,
                                            java.util.OptionalInt requiredComponentCount,
                                            java.util.OptionalInt requiredComponentSize)
        Construct a new immutable SMFSchemaAttribute instance.
        Parameters:
        name - The value for the name attribute
        requiredComponentType - The value for the requiredComponentType attribute
        requiredComponentCount - The value for the requiredComponentCount attribute
        requiredComponentSize - The value for the requiredComponentSize attribute
        Returns:
        An immutable SMFSchemaAttribute instance
      • copyOf

        public static SMFSchemaAttribute copyOf​(SMFSchemaAttributeType instance)
        Creates an immutable copy of a SMFSchemaAttributeType 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 SMFSchemaAttribute instance