Type - class of mapped typeId - class of mapped type's IDpublic abstract class GenericTypeMapping<Type,Id> extends TypeMapping
TypeMapping. All subclasses should extend this class instead of TypeMapping while
it's generally better to use TypeMapping where the exact type of mapping is not known or not relevantFIELD_ID, FIELD_INDEX, FIELD_TYPE, FIELD_VERSION| Constructor and Description |
|---|
GenericTypeMapping(String typeAlias,
Class<Type> typeClass,
Class<Id> idClass) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
buildMapping(org.elasticsearch.index.mapper.object.RootObjectMapper.Builder mapperBuilder) |
protected Type |
cast(Object o) |
protected Id |
castId(Object o) |
protected boolean |
filter(Type o) |
org.elasticsearch.common.xcontent.XContentBuilder |
getContentBuilder(Object o)
public for testing.
|
Id |
getId(Object o) |
Class<Id> |
getIdClass() |
MappingSource |
getMappingSource(org.elasticsearch.common.settings.Settings settings) |
ObjectWriteSource |
getObjectSource(Object o) |
Class<Type> |
getTypeClass() |
Long |
getVersion(Object o)
gets version from object or null if not versioned
|
protected abstract Id |
id(Type o)
get Id from object
|
boolean |
isDynamicMapping() |
boolean |
isFiltered(Object entity)
Simple filtering of entities.
|
com.google.common.collect.ImmutableMap<String,Object> |
meta() |
abstract Type |
read(Map<String,Object> source)
read object from source.
|
Object |
read(ObjectReadSource source) |
abstract Id |
toId(String id) |
String |
toIdString(Object id) |
abstract String |
toString(Id id) |
protected abstract Long |
version(Type o)
get version from object
|
void |
write(org.elasticsearch.common.xcontent.XContentBuilder contentBuilder,
Object o) |
protected abstract void |
writeObject(org.elasticsearch.common.xcontent.XContentBuilder contentBuilder,
Type o) |
deleteBuilderRequest, deleteBuilderRequest, deleteRequest, deleteRequest, getIdString, getTypeAlias, indexBuilderRequest, indexRequest, isVersionedpublic final MappingSource getMappingSource(org.elasticsearch.common.settings.Settings settings)
getMappingSource in class TypeMappingMappingSource for this typepublic boolean isDynamicMapping()
public ObjectWriteSource getObjectSource(Object o)
getObjectSource in class TypeMappingObjectWriteSource for this objectpublic final org.elasticsearch.common.xcontent.XContentBuilder getContentBuilder(Object o) throws IOException
IOExceptionpublic final void write(org.elasticsearch.common.xcontent.XContentBuilder contentBuilder,
Object o)
throws IOException
IOExceptionpublic Class<Type> getTypeClass()
getTypeClass in class TypeMappingpublic Class<Id> getIdClass()
getIdClass in class TypeMappingpublic final boolean isFiltered(Object entity)
TypeMappingisFiltered in class TypeMappingtrue if entity must not be persisted to indexpublic final Id getId(Object o)
getId in class TypeMapping#setId(Object, Object)public Long getVersion(Object o)
TypeMappinggetVersion in class TypeMappingprotected boolean filter(Type o)
public final String toIdString(Object id)
toIdString in class TypeMappingTypeMapping.toId(String)public abstract Id toId(String id)
toId in class TypeMappingTypeMapping.toIdString(Object)protected abstract Id id(Type o)
getId(Object)protected abstract Long version(Type o)
getVersion(Object)protected abstract void buildMapping(org.elasticsearch.index.mapper.object.RootObjectMapper.Builder mapperBuilder)
throws IOException
IOExceptionprotected abstract void writeObject(org.elasticsearch.common.xcontent.XContentBuilder contentBuilder,
Type o)
throws IOException
IOExceptionpublic Object read(ObjectReadSource source)
read in class TypeMappingObjectReadSource or null if not applicable or doc doesn't existCopyright © 2016 Molindo GmbH. All Rights Reserved.