java.lang.Object
org.springframework.data.mongodb.core.mapping.MongoField
Value Object for representing a field to read/write within a MongoDB
Document.- Since:
- 4.2
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMongoField(FieldName name, Class<?> targetFieldType, int fieldOrder) protectedMongoField(FieldName name, FieldType fieldType, int fieldOrder) -
Method Summary
Modifier and TypeMethodDescriptionstatic MongoField.MongoFieldBuilderbuilder()booleanstatic MongoFieldCreate a newMongoFieldwith given name.static MongoFieldCreate a newMongoFieldwith given name.Get the fields target type if defined.getName()intgetOrder()Get the position of the field within the target document.inthashCode()toString()
-
Constructor Details
-
MongoField
-
MongoField
-
-
Method Details
-
fromKey
Create a newMongoFieldwith given name.- Parameters:
name- the name to be used as is (with all its potentially special characters).- Returns:
- new instance of
MongoField.
-
fromPath
Create a newMongoFieldwith given name.- Parameters:
name- the name to be used path expression.- Returns:
- new instance of
MongoField.
-
builder
- Returns:
- new instance of
MongoField.MongoFieldBuilder.
-
getName
- Returns:
- never null.
-
getOrder
public int getOrder()Get the position of the field within the target document.- Returns:
Integer.MAX_VALUEif undefined.
-
getFieldType
Get the fields target type if defined.- Returns:
- never null.
-
equals
-
hashCode
public int hashCode() -
toString
-