Class PSet<Item>
- java.lang.Object
-
- net.morimekta.providence.descriptor.PContainer<java.util.Set<Item>>
-
- net.morimekta.providence.descriptor.PSet<Item>
-
- All Implemented Interfaces:
PDescriptor
public class PSet<Item> extends PContainer<java.util.Set<Item>>
Descriptor for a set with item type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePSet.Builder<I>Container builder used in serialization.static classPSet.DefaultBuilder<I>Default builder returning an ImmutableSet.static classPSet.SortedBuilder<I extends java.lang.Comparable<I>>Default builder returning an ImmutableSortedSet.-
Nested classes/interfaces inherited from class net.morimekta.providence.descriptor.PContainer
PContainer.Type
-
-
Constructor Summary
Constructors Constructor Description PSet(PDescriptorProvider itemType, java.util.function.IntFunction<PSet.Builder<Item>> builderSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PSet.Builder<Item>builder(int capacity)Get an instance builder for the container.booleanequals(java.lang.Object o)java.lang.ObjectgetDefaultValue()java.lang.StringgetName()The name of the type is the Identifier string from the IDL.java.lang.StringgetQualifiedName(java.lang.String programContext)This will return the qualified name of the type given the program context.PTypegetType()inthashCode()static <I extends java.lang.Comparable<I>>
PContainerProvider<java.util.Set<I>,PSet<I>>orderedProvider(PDescriptorProvider itemDesc)static <I> PContainerProvider<java.util.Set<I>,PSet<I>>provider(PDescriptorProvider itemDesc)static <I extends java.lang.Comparable<I>>
PContainerProvider<java.util.Set<I>,PSet<I>>sortedProvider(PDescriptorProvider itemDesc)-
Methods inherited from class net.morimekta.providence.descriptor.PContainer
getProgramName, itemDescriptor, toString, typeForName
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.descriptor.PDescriptor
getQualifiedName
-
-
-
-
Constructor Detail
-
PSet
public PSet(PDescriptorProvider itemType, java.util.function.IntFunction<PSet.Builder<Item>> builderSupplier)
-
-
Method Detail
-
getName
@Nonnull public java.lang.String getName()
Description copied from interface:PDescriptorThe name of the type is the Identifier string from the IDL.- Returns:
- The name of the type. Not including package.
-
getQualifiedName
@Nonnull public java.lang.String getQualifiedName(java.lang.String programContext)
Description copied from interface:PDescriptorThis will return the qualified name of the type given the program context.- Parameters:
programContext- The program which the type should be referenced from.- Returns:
- The qualified name of the type. Including program if not matching with programContext.
-
getType
@Nonnull public PType getType()
- Returns:
- Get the field type.
-
getDefaultValue
@Nullable public java.lang.Object getDefaultValue()
- Returns:
- The default value for the type used for default and required fields. Note that some primitive types don't support null values, and will have methods returning a default value regardless of the field required value setting.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
builder
@Nonnull public PSet.Builder<Item> builder(int capacity)
Description copied from class:PContainerGet an instance builder for the container.- Specified by:
builderin classPContainer<java.util.Set<Item>>- Parameters:
capacity- Requested container capacity.- Returns:
- The instance builder.
-
provider
@Nonnull public static <I> PContainerProvider<java.util.Set<I>,PSet<I>> provider(PDescriptorProvider itemDesc)
-
sortedProvider
@Nonnull public static <I extends java.lang.Comparable<I>> PContainerProvider<java.util.Set<I>,PSet<I>> sortedProvider(PDescriptorProvider itemDesc)
-
orderedProvider
@Nonnull public static <I extends java.lang.Comparable<I>> PContainerProvider<java.util.Set<I>,PSet<I>> orderedProvider(PDescriptorProvider itemDesc)
-
-