Class ImmutableCtxProperty

java.lang.Object
dk.mada.jaxrs.generator.mpclient.dto.tmpl.ImmutableCtxProperty
All Implemented Interfaces:
CtxProperty

@Generated(from="CtxProperty", generator="Immutables") @Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableCtxProperty extends Object implements CtxProperty
Immutable implementation of CtxProperty.

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

  • Method Details

    • name

      public String name()
      Returns the java field name.
      Specified by:
      name in interface CtxProperty
      Returns:
      the java field name
    • baseName

      public String baseName()
      Returns the OpenApi property name.
      Specified by:
      baseName in interface CtxProperty
      Returns:
      the OpenApi property name
    • nameInCamelCase

      public String nameInCamelCase()
      Returns the java field name in camel case, used to construct method names.
      Specified by:
      nameInCamelCase in interface CtxProperty
      Returns:
      the java field name in camel case, used to construct method names
    • nameInSnakeCase

      public String nameInSnakeCase()
      Returns the java field name in snake case, used to construct constant names.
      Specified by:
      nameInSnakeCase in interface CtxProperty
      Returns:
      the java field name in snake case, used to construct constant names
    • datatypeWithEnum

      public String datatypeWithEnum()
      Returns the java type name.
      Specified by:
      datatypeWithEnum in interface CtxProperty
      Returns:
      the java type name
    • getter

      public String getter()
      Returns the name of the getter.
      Specified by:
      getter in interface CtxProperty
      Returns:
      the name of the getter
    • setter

      public String setter()
      Returns the name of the setter.
      Specified by:
      setter in interface CtxProperty
      Returns:
      the name of the setter
    • dataType

      public @Nullable String dataType()
      Returns dataType in an enumeration or null.
      Specified by:
      dataType in interface CtxProperty
      Returns:
      dataType in an enumeration or null
    • allowableValues

      public @Nullable CtxEnum allowableValues()
      Returns allowable enumeration values or null.
      Specified by:
      allowableValues in interface CtxProperty
      Returns:
      allowable enumeration values or null
    • defaultValue

      public @Nullable String defaultValue()
      Returns the property default value, or null.
      Specified by:
      defaultValue in interface CtxProperty
      Returns:
      the property default value, or null
    • description

      public Optional<String> description()
      Returns the optional description of the property.
      Specified by:
      description in interface CtxProperty
      Returns:
      the optional description of the property
    • validation

      public Optional<CtxValidation> validation()
      Returns context for bean validation if relevant for this property.
      Specified by:
      validation in interface CtxProperty
      Returns:
      context for bean validation if relevant for this property
    • isArray

      public boolean isArray()
      Returns true if this property should be rendered as an array, otherwise false.
      Specified by:
      isArray in interface CtxProperty
      Returns:
      true if this property should be rendered as an array, otherwise false
    • isMap

      public boolean isMap()
      Returns true if this property should be rendered as a map, otherwise false.
      Specified by:
      isMap in interface CtxProperty
      Returns:
      true if this property should be rendered as a map, otherwise false
    • isSet

      public boolean isSet()
      Returns true if this property should be rendered as a set, otherwise false.
      Specified by:
      isSet in interface CtxProperty
      Returns:
      true if this property should be rendered as a set, otherwise false
    • isContainer

      public boolean isContainer()
      Returns true if this property is a container, otherwise false.
      Specified by:
      isContainer in interface CtxProperty
      Returns:
      true if this property is a container, otherwise false
    • isDate

      public boolean isDate()
      Returns true if this property should be rendered as a date, otherwise false.
      Specified by:
      isDate in interface CtxProperty
      Returns:
      true if this property should be rendered as a date, otherwise false
    • isDateTime

      public boolean isDateTime()
      Returns true if this property should be rendered as a date-time, otherwise false.
      Specified by:
      isDateTime in interface CtxProperty
      Returns:
      true if this property should be rendered as a date-time, otherwise false
    • isEnum

      public boolean isEnum()
      Returns true if this property should render an enumeration, otherwise false.
      Specified by:
      isEnum in interface CtxProperty
      Returns:
      true if this property should render an enumeration, otherwise false
    • required

      public boolean required()
      Returns true if this property is required.
      Specified by:
      required in interface CtxProperty
      Returns:
      true if this property is required
    • notNull

      public boolean notNull()
      Returns true if the property must be NotNull.
      Specified by:
      notNull in interface CtxProperty
      Returns:
      true if the property must be NotNull
    • example

      public Optional<String> example()
      Returns an optional property example.
      Specified by:
      example in interface CtxProperty
      Returns:
      an optional property example
    • madaProp

      public CtxPropertyExt madaProp()
      Returns additional custom template data for the property.
      Specified by:
      madaProp in interface CtxProperty
      Returns:
      additional custom template data for the property
    • withName

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

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

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

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

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

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

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

      public final ImmutableCtxProperty withDataType(@Nullable String value)
      Copy the current immutable object by setting a value for the dataType attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for dataType (can be null)
      Returns:
      A modified copy or the this object
    • withAllowableValues

      public final ImmutableCtxProperty withAllowableValues(@Nullable CtxEnum value)
      Copy the current immutable object by setting a value for the allowableValues attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allowableValues (can be null)
      Returns:
      A modified copy or the this object
    • withDefaultValue

      public final ImmutableCtxProperty withDefaultValue(@Nullable String value)
      Copy the current immutable object by setting a value for the defaultValue attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for defaultValue (can be null)
      Returns:
      A modified copy or the this object
    • withDescription

      public final ImmutableCtxProperty withDescription(String value)
      Copy the current immutable object by setting a present value for the optional description attribute.
      Parameters:
      value - The value for description
      Returns:
      A modified copy or this if not changed
    • withDescription

      public final ImmutableCtxProperty withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for description
      Returns:
      A modified copy or this if not changed
    • withValidation

      public final ImmutableCtxProperty withValidation(CtxValidation value)
      Copy the current immutable object by setting a present value for the optional validation attribute.
      Parameters:
      value - The value for validation
      Returns:
      A modified copy or this if not changed
    • withValidation

      public final ImmutableCtxProperty withValidation(Optional<? extends CtxValidation> optional)
      Copy the current immutable object by setting an optional value for the validation attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for validation
      Returns:
      A modified copy or this if not changed
    • withIsArray

      public final ImmutableCtxProperty withIsArray(boolean value)
      Copy the current immutable object by setting a value for the isArray attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isArray
      Returns:
      A modified copy or the this object
    • withIsMap

      public final ImmutableCtxProperty withIsMap(boolean value)
      Copy the current immutable object by setting a value for the isMap attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isMap
      Returns:
      A modified copy or the this object
    • withIsSet

      public final ImmutableCtxProperty withIsSet(boolean value)
      Copy the current immutable object by setting a value for the isSet attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isSet
      Returns:
      A modified copy or the this object
    • withIsContainer

      public final ImmutableCtxProperty withIsContainer(boolean value)
      Copy the current immutable object by setting a value for the isContainer attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isContainer
      Returns:
      A modified copy or the this object
    • withIsDate

      public final ImmutableCtxProperty withIsDate(boolean value)
      Copy the current immutable object by setting a value for the isDate attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isDate
      Returns:
      A modified copy or the this object
    • withIsDateTime

      public final ImmutableCtxProperty withIsDateTime(boolean value)
      Copy the current immutable object by setting a value for the isDateTime attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isDateTime
      Returns:
      A modified copy or the this object
    • withIsEnum

      public final ImmutableCtxProperty withIsEnum(boolean value)
      Copy the current immutable object by setting a value for the isEnum attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isEnum
      Returns:
      A modified copy or the this object
    • withRequired

      public final ImmutableCtxProperty withRequired(boolean value)
      Copy the current immutable object by setting a value for the required attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for required
      Returns:
      A modified copy or the this object
    • withNotNull

      public final ImmutableCtxProperty withNotNull(boolean value)
      Copy the current immutable object by setting a value for the notNull attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for notNull
      Returns:
      A modified copy or the this object
    • withExample

      public final ImmutableCtxProperty withExample(String value)
      Copy the current immutable object by setting a present value for the optional example attribute.
      Parameters:
      value - The value for example
      Returns:
      A modified copy or this if not changed
    • withExample

      public final ImmutableCtxProperty withExample(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the example attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for example
      Returns:
      A modified copy or this if not changed
    • withMadaProp

      public final ImmutableCtxProperty withMadaProp(CtxPropertyExt value)
      Copy the current immutable object by setting a value for the madaProp attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for madaProp
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCtxProperty 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: name, baseName, nameInCamelCase, nameInSnakeCase, datatypeWithEnum, getter, setter, dataType, allowableValues, defaultValue, description, validation, isArray, isMap, isSet, isContainer, isDate, isDateTime, isEnum, required, notNull, example, madaProp.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableCtxProperty copyOf(CtxProperty instance)
      Creates an immutable copy of a CtxProperty 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 CtxProperty instance
    • builder

      public static ImmutableCtxProperty.Builder builder()
      Creates a builder for ImmutableCtxProperty.
       ImmutableCtxProperty.builder()
          .name(String) // required name
          .baseName(String) // required baseName
          .nameInCamelCase(String) // required nameInCamelCase
          .nameInSnakeCase(String) // required nameInSnakeCase
          .datatypeWithEnum(String) // required datatypeWithEnum
          .getter(String) // required getter
          .setter(String) // required setter
          .dataType(String | null) // nullable dataType
          .allowableValues(dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxEnum | null) // nullable allowableValues
          .defaultValue(String | null) // nullable defaultValue
          .description(Optional<String>) // optional description
          .validation(Optional<dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxValidation>) // optional validation
          .isArray(boolean) // required isArray
          .isMap(boolean) // required isMap
          .isSet(boolean) // required isSet
          .isContainer(boolean) // required isContainer
          .isDate(boolean) // required isDate
          .isDateTime(boolean) // required isDateTime
          .isEnum(boolean) // required isEnum
          .required(boolean) // required required
          .notNull(boolean) // required notNull
          .example(Optional<String>) // optional example
          .madaProp(dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxPropertyExt) // required madaProp
          .build();
       
      Returns:
      A new ImmutableCtxProperty builder