/** * Returns a {@link PrimitiveBuilder} for the repeated primitive type * {@code type}. * * @param type a {@link PrimitiveTypeName} * @return a primitive builder for {@code type} that will return this * builder for additional fields. */ public PrimitiveBuilder<GroupBuilder<P>> repeated( PrimitiveTypeName type) { return new PrimitiveBuilder<GroupBuilder<P>>(this, type) .repetition(Type.Repetition.REPEATED); }
/** * Returns a {@link PrimitiveBuilder} for the required primitive type * {@code type}. * * @param type a {@link PrimitiveTypeName} * @return a primitive builder for {@code type} that will return this * builder for additional fields. */ public PrimitiveBuilder<GroupBuilder<P>> required( PrimitiveTypeName type) { return new PrimitiveBuilder<GroupBuilder<P>>(this, type) .repetition(Type.Repetition.REQUIRED); }
/** * Returns a {@link PrimitiveBuilder} for the optional primitive type * {@code type}. * * @param type a {@link PrimitiveTypeName} * @return a primitive builder for {@code type} that will return this * builder for additional fields. */ public PrimitiveBuilder<GroupBuilder<P>> optional( PrimitiveTypeName type) { return new PrimitiveBuilder<GroupBuilder<P>>(this, type) .repetition(Type.Repetition.OPTIONAL); }
public static PrimitiveBuilder<PrimitiveType> primitive( PrimitiveTypeName type, Type.Repetition repetition) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(repetition); }
/** * Returns a builder to construct a repeated {@link PrimitiveType}. * * @param type a {@link PrimitiveTypeName} for the constructed type * @return a {@link PrimitiveBuilder} */ public static PrimitiveBuilder<PrimitiveType> repeated( PrimitiveTypeName type) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(Type.Repetition.REPEATED); }
/** * Returns a builder to construct an optional {@link PrimitiveType}. * * @param type a {@link PrimitiveTypeName} for the constructed type * @return a {@link PrimitiveBuilder} */ public static PrimitiveBuilder<PrimitiveType> optional( PrimitiveTypeName type) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(Type.Repetition.OPTIONAL); }
public PrimitiveBuilder<GroupBuilder<P>> primitive( PrimitiveTypeName type, Type.Repetition repetition) { return new PrimitiveBuilder<GroupBuilder<P>>(this, type) .repetition(repetition); }
/** * Returns a builder to construct a required {@link PrimitiveType}. * * @param type a {@link PrimitiveTypeName} for the constructed type * @return a {@link PrimitiveBuilder} */ public static PrimitiveBuilder<PrimitiveType> required( PrimitiveTypeName type) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(Type.Repetition.REQUIRED); }