Class PList<Item>
- java.lang.Object
-
- net.morimekta.providence.descriptor.PContainer<java.util.List<Item>>
-
- net.morimekta.providence.descriptor.PList<Item>
-
- All Implemented Interfaces:
PDescriptor
public class PList<Item> extends PContainer<java.util.List<Item>>
Descriptor for a list with item type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePList.Builder<I>Container builder used in serialization.static classPList.DefaultBuilder<I>Default builder returning an ImmutableList.-
Nested classes/interfaces inherited from class net.morimekta.providence.descriptor.PContainer
PContainer.Type
-
-
Constructor Summary
Constructors Constructor Description PList(PDescriptorProvider itemType, java.util.function.IntFunction<PList.Builder<Item>> builderSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PList.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> PContainerProvider<java.util.List<I>,PList<I>>provider(PDescriptorProvider itemDesc)static <I> PContainerProvider<java.util.List<I>,PList<I>>provider(PDescriptorProvider itemDesc, java.util.function.IntFunction<PList.Builder<I>> builderFactory)-
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
-
PList
public PList(PDescriptorProvider itemType, java.util.function.IntFunction<PList.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 PList.Builder<Item> builder(int capacity)
Description copied from class:PContainerGet an instance builder for the container.- Specified by:
builderin classPContainer<java.util.List<Item>>- Parameters:
capacity- Requested container capacity.- Returns:
- The instance builder.
-
provider
@Nonnull public static <I> PContainerProvider<java.util.List<I>,PList<I>> provider(PDescriptorProvider itemDesc)
-
provider
@Nonnull public static <I> PContainerProvider<java.util.List<I>,PList<I>> provider(PDescriptorProvider itemDesc, java.util.function.IntFunction<PList.Builder<I>> builderFactory)
-
-