/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#componentType() componentType} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for componentType * @return A modified copy of the {@code this} object */ public final SMFAttribute withComponentType(SMFComponentType value) { if (this.componentType == value) return this; SMFComponentType newValue = Objects.requireNonNull(value, "componentType"); return validate(new SMFAttribute(this, this.name, newValue, this.componentCount, this.componentSizeBits)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#componentSizeBits() componentSizeBits} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for componentSizeBits * @return A modified copy of the {@code this} object */ public final SMFAttribute withComponentSizeBits(int value) { if (this.componentSizeBits == value) return this; return validate(new SMFAttribute(this, this.name, this.componentType, this.componentCount, value)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#name() name} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for name * @return A modified copy of the {@code this} object */ public final SMFAttribute withName(SMFAttributeName value) { if (this.name == value) return this; SMFAttributeName newValue = Objects.requireNonNull(value, "name"); return validate(new SMFAttribute(this, newValue, this.componentType, this.componentCount, this.componentSizeBits)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#name() name} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for name * @return A modified copy of the {@code this} object */ public final SMFAttribute withName(SMFAttributeName value) { if (this.name == value) return this; SMFAttributeName newValue = Objects.requireNonNull(value, "name"); return validate(new SMFAttribute(this, newValue, this.componentType, this.componentCount, this.componentSizeBits)); }
/** * Builds a new {@link SMFAttribute SMFAttribute}. * @return An immutable instance of SMFAttribute * @throws java.lang.IllegalStateException if any required attributes are missing */ public SMFAttribute build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return SMFAttribute.validate(new SMFAttribute(null, name, componentType, componentCount, componentSizeBits)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#componentCount() componentCount} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for componentCount * @return A modified copy of the {@code this} object */ public final SMFAttribute withComponentCount(int value) { if (this.componentCount == value) return this; return validate(new SMFAttribute(this, this.name, this.componentType, value, this.componentSizeBits)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#componentCount() componentCount} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for componentCount * @return A modified copy of the {@code this} object */ public final SMFAttribute withComponentCount(int value) { if (this.componentCount == value) return this; return validate(new SMFAttribute(this, this.name, this.componentType, value, this.componentSizeBits)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#componentSizeBits() componentSizeBits} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for componentSizeBits * @return A modified copy of the {@code this} object */ public final SMFAttribute withComponentSizeBits(int value) { if (this.componentSizeBits == value) return this; return validate(new SMFAttribute(this, this.name, this.componentType, this.componentCount, value)); }
/** * Construct a new immutable {@code SMFAttribute} instance. * @param name The value for the {@code name} attribute * @param componentType The value for the {@code componentType} attribute * @param componentCount The value for the {@code componentCount} attribute * @param componentSizeBits The value for the {@code componentSizeBits} attribute * @return An immutable SMFAttribute instance */ public static SMFAttribute of(SMFAttributeName name, SMFComponentType componentType, int componentCount, int componentSizeBits) { return validate(new SMFAttribute(name, componentType, componentCount, componentSizeBits)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeType#componentType() componentType} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for componentType * @return A modified copy of the {@code this} object */ public final SMFAttribute withComponentType(SMFComponentType value) { if (this.componentType == value) return this; SMFComponentType newValue = Objects.requireNonNull(value, "componentType"); return validate(new SMFAttribute(this, this.name, newValue, this.componentCount, this.componentSizeBits)); }
/** * Construct a new immutable {@code SMFAttribute} instance. * @param name The value for the {@code name} attribute * @param componentType The value for the {@code componentType} attribute * @param componentCount The value for the {@code componentCount} attribute * @param componentSizeBits The value for the {@code componentSizeBits} attribute * @return An immutable SMFAttribute instance */ public static SMFAttribute of(SMFAttributeName name, SMFComponentType componentType, int componentCount, int componentSizeBits) { return validate(new SMFAttribute(name, componentType, componentCount, componentSizeBits)); }
/** * Builds a new {@link SMFAttribute SMFAttribute}. * @return An immutable instance of SMFAttribute * @throws java.lang.IllegalStateException if any required attributes are missing */ public SMFAttribute build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return SMFAttribute.validate(new SMFAttribute(null, name, componentType, componentCount, componentSizeBits)); }