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 interface
PList.Builder<I>
Container builder used in serialization.static class
PList.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)
boolean
equals(java.lang.Object o)
java.lang.Object
getDefaultValue()
java.lang.String
getName()
The name of the type is the Identifier string from the IDL.java.lang.String
getQualifiedName(java.lang.String programContext)
This will return the qualified name of the type given the program context.PType
getType()
int
hashCode()
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:PDescriptor
The 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:PDescriptor
This 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
builder
@Nonnull public PList.Builder<Item> builder(int capacity)
-
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)
-
-