Package org.apache.avro.generic

# Class PrimitivesArrays

java.lang.Object
org.apache.avro.generic.PrimitivesArrays

public class PrimitivesArrays extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`PrimitivesArrays.BooleanArray`
`static class`
`PrimitivesArrays.DoubleArray`
`static class`
`PrimitivesArrays.FloatArray`
`static class`
`PrimitivesArrays.IntArray`
`static class`
`PrimitivesArrays.LongArray`
`static class`
`PrimitivesArrays.PrimitiveArray<T>`

## Constructor Summary

Constructors
Constructor
Description
`PrimitivesArrays()`

## Method Summary

Modifier and Type
Method
Description
`static GenericData.AbstractArray<?>`
`createOptimizedArray(int size, Schema schema, Schema.Type valueType)`
Create a primitive array if the value type is has an associated optimised implementation, otherwise a generic array is returned.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PrimitivesArrays

public PrimitivesArrays()

## Method Details

### createOptimizedArray

public static GenericData.AbstractArray<?> createOptimizedArray(int size, Schema schema, Schema.Type valueType)
Create a primitive array if the value type is has an associated optimised implementation, otherwise a generic array is returned. The value type is determined form the convertedElementType if supplied, otherwise the underlying type from the schema

Parameters:
  `size` - the size of the array to create
  `schema` - the schema of the array
  `valueType` - the converted elements value type. This may not be the same and the schema if for instance there is a logical type, and a convertor is use
Returns:
  an instance of a primitive array or a Generic array if the value type is does not have an associated optimised implementation.