Record Class ResourceLoadStrategy

java.lang.Object
java.lang.Record
io.micronaut.core.io.ResourceLoadStrategy
Record Components:
type - The strategy type. Defaults to ResourceLoadStrategyType.FAIL_ON_DUPLICATE.
warnOnDuplicates - Whether to warn when duplicates are found. Applies only to ResourceLoadStrategyType.FIRST_MATCH.
mergeOrder - Artifact name regex patterns used to order resources before merging. Applies only to ResourceLoadStrategyType.MERGE_ALL.

@NullMarked public record ResourceLoadStrategy(ResourceLoadStrategyType type, boolean warnOnDuplicates, List<String> mergeOrder) extends Record
Resource loading strategy.
Since:
5.0.0
  • Constructor Details

    • ResourceLoadStrategy

      public ResourceLoadStrategy(ResourceLoadStrategyType type, boolean warnOnDuplicates, List<String> mergeOrder)
      Creates an instance of a ResourceLoadStrategy record class.
      Parameters:
      type - the value for the type record component
      warnOnDuplicates - the value for the warnOnDuplicates record component
      mergeOrder - the value for the mergeOrder record component
  • Method Details

    • defaultStrategy

      public static ResourceLoadStrategy defaultStrategy()
      Returns the default resource load strategy.
      Returns:
      The default resource load strategy.
      Since:
      5.0.0
    • builder

      public static ResourceLoadStrategy.Builder builder()
      Creates a new builder.
      Returns:
      A new builder.
      Since:
      5.0.0
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public ResourceLoadStrategyType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • warnOnDuplicates

      public boolean warnOnDuplicates()
      Returns the value of the warnOnDuplicates record component.
      Returns:
      the value of the warnOnDuplicates record component
    • mergeOrder

      public List<String> mergeOrder()
      Returns the value of the mergeOrder record component.
      Returns:
      the value of the mergeOrder record component