Enum Class TypeProjection.Source

java.lang.Object
java.lang.Enum<TypeProjection.Source>
org.gcube.informationsystem.types.reference.properties.TypeProjection.Source
All Implemented Interfaces:
Serializable, Comparable<TypeProjection.Source>, Constable
Enclosing interface:
TypeProjection

public static enum TypeProjection.Source extends Enum<TypeProjection.Source>
Whether a TypeProjection was computed by the auto-generation algorithm, defined by an admin, or is the minimal safety-net fallback used when the full auto-generation computation itself fails. A closed, 3-value set — modeled as a real enum rather than String constants for compile-time safety (unlike most other @ISProperty string fields in this model, which hold open-ended values such as a Type name, and are therefore correctly plain Strings). FALLBACK is deliberately a third value of this same enum rather than an orthogonal boolean flag: it can only ever occur as a sub-case of AUTO_GENERATED (a CUSTOM projection is validated at submission time and rejected outright on failure, never silently degraded), so a separate flag would make an impossible combination — CUSTOM + "degraded" — representable for no reason. toString() and fromString(String) keep the wire value the hyphenated form already in use (e.g. "auto-generated") rather than the Java constant name Jackson would otherwise default to.
  • Enum Constant Details

    • AUTO_GENERATED

      public static final TypeProjection.Source AUTO_GENERATED
      Computed by the auto-generation algorithm from the owning Type's schema.
    • CUSTOM

      public static final TypeProjection.Source CUSTOM
      Defined by an admin via PUT /types/{type-name}/projection.
    • FALLBACK

      public static final TypeProjection.Source FALLBACK
      The minimal, always-valid baseline (id + effective type only), persisted in place of the intended auto-generated default when computing the latter threw or otherwise failed — a safety net so a bug in the generation algorithm never blocks the Type create/update that triggered it.
  • Method Details

    • values

      public static TypeProjection.Source[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TypeProjection.Source valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<TypeProjection.Source>
    • fromString

      public static TypeProjection.Source fromString(String value)
      Parses a wire value.
      Parameters:
      value - the wire string to parse
      Returns:
      the matching TypeProjection.Source
      Throws:
      IllegalArgumentException - if value does not match any TypeProjection.Source