Class RecipeItemRef

java.lang.Object
ke.ric.cooking.data.RecipeItemRef

public final class RecipeItemRef extends Object
Immutable identity of one recipe item. Quantity and selection weight belong to the recipe position that owns the reference, not to the identity itself.

RecipeItemRef.Kind.LEGACY_AUTO records provenance for old untyped strings. It deliberately does not guess whether an ID is Heirloom or vanilla: runtime resolution must retain the historical custom-first, vanilla-fallback order.

  • Constructor Details

    • RecipeItemRef

      public RecipeItemRef(String item, String customItem, ProviderItemRef providerItem)
      Backward-compatible constructor for the three explicit typed identities.
  • Method Details

    • item

      public static RecipeItemRef item(String materialId)
    • vanilla

      public static RecipeItemRef vanilla(String materialId)
    • customItem

      public static RecipeItemRef customItem(String customItemId)
    • custom

      public static RecipeItemRef custom(String customItemId)
    • providerItem

      public static RecipeItemRef providerItem(String serialized)
    • providerItem

      public static RecipeItemRef providerItem(ProviderItemRef providerItem)
    • provider

      public static RecipeItemRef provider(String serialized)
    • legacyAuto

      public static RecipeItemRef legacyAuto(String id)
    • fromLegacyOutput

      public static RecipeItemRef fromLegacyOutput(String id)
      Legacy output strings retain custom-first, vanilla-fallback provenance.
    • fromLegacyAuto

      public static RecipeItemRef fromLegacyAuto(String id)
      Legacy return/byproduct strings retain custom-first, vanilla-fallback provenance.
    • kind

      public RecipeItemRef.Kind kind()
    • item

      public String item()
    • customItem

      public String customItem()
    • providerItem

      public ProviderItemRef providerItem()
    • isItem

      public boolean isItem()
    • isVanillaItem

      public boolean isVanillaItem()
    • isCustomItem

      public boolean isCustomItem()
    • isProviderItem

      public boolean isProviderItem()
    • isLegacyAuto

      public boolean isLegacyAuto()
    • legacyId

      public String legacyId()
      Backward-compatible string form used by existing runtime consumers.
    • getItem

      public String getItem()
    • getCustomItem

      public String getCustomItem()
    • getProviderItem

      public String getProviderItem()
    • getProviderItemRef

      public ProviderItemRef getProviderItemRef()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object