Class ImmutableDataSetDto

java.lang.Object
fr.enedis.chutney.dataset.api.ImmutableDataSetDto
All Implemented Interfaces:
DataSetDto

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

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

  • Method Details

    • id

      public Optional<String> id()
      Specified by:
      id in interface DataSetDto
      Returns:
      The value of the id attribute
    • name

      public String name()
      Specified by:
      name in interface DataSetDto
      Returns:
      The value of the name attribute
    • description

      public String description()
      Specified by:
      description in interface DataSetDto
      Returns:
      The value of the description attribute
    • lastUpdated

      public Instant lastUpdated()
      Specified by:
      lastUpdated in interface DataSetDto
      Returns:
      The value of the lastUpdated attribute
    • tags

      public List<String> tags()
      Specified by:
      tags in interface DataSetDto
      Returns:
      The value of the tags attribute
    • constants

      public List<KeyValue> constants()
      Specified by:
      constants in interface DataSetDto
      Returns:
      The value of the constants attribute
    • datatable

      public List<List<KeyValue>> datatable()
      Specified by:
      datatable in interface DataSetDto
      Returns:
      The value of the datatable attribute
    • scenarioUsage

      public List<String> scenarioUsage()
      Specified by:
      scenarioUsage in interface DataSetDto
      Returns:
      The value of the scenarioUsage attribute
    • campaignUsage

      public List<String> campaignUsage()
      Specified by:
      campaignUsage in interface DataSetDto
      Returns:
      The value of the campaignUsage attribute
    • scenarioInCampaignUsage

      public Map<String,Set<String>> scenarioInCampaignUsage()
      Specified by:
      scenarioInCampaignUsage in interface DataSetDto
      Returns:
      The value of the scenarioInCampaignUsage attribute
    • withId

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

      public final ImmutableDataSetDto withId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the id 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 id
      Returns:
      A modified copy or this if not changed
    • withName

      public final ImmutableDataSetDto 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
    • withDescription

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

      public final ImmutableDataSetDto withLastUpdated(Instant value)
      Copy the current immutable object by setting a value for the lastUpdated attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for lastUpdated
      Returns:
      A modified copy or the this object
    • withTags

      public final ImmutableDataSetDto withTags(String... elements)
      Copy the current immutable object with elements that replace the content of tags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTags

      public final ImmutableDataSetDto withTags(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of tags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of tags elements to set
      Returns:
      A modified copy or this if not changed
    • withConstants

      public final ImmutableDataSetDto withConstants(KeyValue... elements)
      Copy the current immutable object with elements that replace the content of constants.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withConstants

      public final ImmutableDataSetDto withConstants(Iterable<? extends KeyValue> elements)
      Copy the current immutable object with elements that replace the content of constants. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of constants elements to set
      Returns:
      A modified copy or this if not changed
    • withDatatable

      @SafeVarargs public final ImmutableDataSetDto withDatatable(List<KeyValue>... elements)
      Copy the current immutable object with elements that replace the content of datatable.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withDatatable

      public final ImmutableDataSetDto withDatatable(Iterable<? extends List<KeyValue>> elements)
      Copy the current immutable object with elements that replace the content of datatable. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of datatable elements to set
      Returns:
      A modified copy or this if not changed
    • withScenarioUsage

      public final ImmutableDataSetDto withScenarioUsage(String... elements)
      Copy the current immutable object with elements that replace the content of scenarioUsage.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withScenarioUsage

      public final ImmutableDataSetDto withScenarioUsage(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of scenarioUsage. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of scenarioUsage elements to set
      Returns:
      A modified copy or this if not changed
    • withCampaignUsage

      public final ImmutableDataSetDto withCampaignUsage(String... elements)
      Copy the current immutable object with elements that replace the content of campaignUsage.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCampaignUsage

      public final ImmutableDataSetDto withCampaignUsage(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of campaignUsage. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of campaignUsage elements to set
      Returns:
      A modified copy or this if not changed
    • withScenarioInCampaignUsage

      public final ImmutableDataSetDto withScenarioInCampaignUsage(Map<String,? extends Set<String>> entries)
      Copy the current immutable object by replacing the scenarioInCampaignUsage map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to replace the scenarioInCampaignUsage map
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDataSetDto 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: id, name, description, lastUpdated, tags, constants, datatable, scenarioUsage, campaignUsage, scenarioInCampaignUsage.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableDataSetDto.Builder builder()
      Creates a builder for ImmutableDataSetDto.
       ImmutableDataSetDto.builder()
          .id(Optional<String>) // optional id
          .name(String) // required name
          .description(String) // optional description
          .lastUpdated(java.time.Instant) // optional lastUpdated
          .addTags|addAllTags(String) // tags elements
          .addConstants|addAllConstants(fr.enedis.chutney.dataset.api.KeyValue) // constants elements
          .addDatatable|addAllDatatable(List<fr.enedis.chutney.dataset.api.KeyValue>) // datatable elements
          .addScenarioUsage|addAllScenarioUsage(String) // scenarioUsage elements
          .addCampaignUsage|addAllCampaignUsage(String) // campaignUsage elements
          .putScenarioInCampaignUsage|putAllScenarioInCampaignUsage(String => Set<String>) // scenarioInCampaignUsage mappings
          .build();
       
      Returns:
      A new ImmutableDataSetDto builder