Interface Palette<T,R>
- 
- Type Parameters:
- T- The type this palette will maintain
- R- The type of registry used to build this palette
 - All Known Subinterfaces:
- Palette.Immutable<I,IR>,- Palette.Mutable<M,MR>
 
 public interface Palette<T,R>Represents a mapping for types to a local identifier. Can be used for mappingObjects tointid's for storage purposes, or for converting stored information to a representable format back intoObjects.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfacePalette.Immutable<I,IR>static interfacePalette.Mutable<M,MR>
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Palette.Immutable<T,R>asImmutable()Palette.Mutable<T,R>asMutable(RegistryHolder registry)Optional<PaletteReference<T,R>>get(int id)Gets thetyperepresented by the given identifier from the mapping.default Optional<T>get(int id, RegistryHolder holder)OptionalIntget(T type)Gets the identifier for the giventype Tif it exists within the mapping.inthighestId()Gets the highest identifier in this palette.Stream<T>stream()Gets alltype Ts contained in this palette.Stream<Map.Entry<T,Integer>>streamWithIds()PaletteType<T,R>type()Gets the type of this palette.
 
- 
- 
- 
Method Detail- 
typePaletteType<T,R> type() Gets the type of this palette.- Returns:
- The palette type
 
 - 
highestIdint highestId() Gets the highest identifier in this palette.- Returns:
- The highest id
 
 - 
getOptional<PaletteReference<T,R>> get(int id) Gets thetyperepresented by the given identifier from the mapping.- Parameters:
- id- The identifier
- Returns:
- The type, if found
 
 - 
getdefault Optional<T> get(int id, RegistryHolder holder) 
 - 
getOptionalInt get(T type) Gets the identifier for the giventype Tif it exists within the mapping.- Parameters:
- type- The type
- Returns:
- The identifier, if found
 
 - 
asMutablePalette.Mutable<T,R> asMutable(RegistryHolder registry) 
 - 
asImmutablePalette.Immutable<T,R> asImmutable() 
 
- 
 
-