Package org.mongounit
Class DatasetGeneratorArguments
java.lang.Object
org.mongounit.DatasetGeneratorArguments
DatasetGeneratorArguments class represents all arguments passed into the DatasetGenerator standalone program.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDatasetGeneratorArguments.DatasetGeneratorArgumentsBuilderclass is a builder pattern class for theDatasetGeneratorArgumentsclass. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()booleancom.mongodb.MongoClientURIinthashCode()voidsetCollectionNames(List<String> collectionNames) voidsetMongoClientURI(com.mongodb.MongoClientURI mongoClientURI) voidsetMongoUnitValueFieldNameIndicator(String mongoUnitValueFieldNameIndicator) voidsetOutputPath(String outputPath) voidsetPreserveBsonTypes(List<String> preserveBsonTypes) toString()
-
Constructor Details
-
DatasetGeneratorArguments
public DatasetGeneratorArguments()Default constructor. -
DatasetGeneratorArguments
public DatasetGeneratorArguments(com.mongodb.MongoClientURI mongoClientURI, List<String> collectionNames, String outputPath, List<String> preserveBsonTypes, String mongoUnitValueFieldNameIndicator) Constructor.- Parameters:
mongoClientURI- Validated URI of the mongo DB to connect to.collectionNames- Optional list of collection names to generate data based on.outputPath- Absolute path to file where to output JSON.preserveBsonTypes- List of BSON types to generate explicit MongoUnit BSON type specification. The specification is based on the names (not values) of theBsonTypeenum.mongoUnitValueFieldNameIndicator- Field name to use as an indicator in developer JSON files to signify that a document is a representation of a special MongoUnit value. The general format of the special name/value pair is "$$BSON_TYPE": value If the JSON is meant to seed the database, 'BSON_TYPE' is to specify a BSON type value based on the naming inBsonType. If the JSON is meant to assert the expected result state, the format is allowed to be simply: "$$": value. In addition, a 'comparator' field is expected as a sibling field name.
-
-
Method Details
-
builder
- Returns:
- Instance of the builder pattern version of the
DatasetGeneratorArgumentsclass.
-
getMongoClientURI
public com.mongodb.MongoClientURI getMongoClientURI()- Returns:
- Validated URI of the mongo DB to connect to.
-
getCollectionNames
- Returns:
- Optional list of collection names to generate data based on.
-
getOutputPath
- Returns:
- Absolute path to file where to output JSON.
-
getPreserveBsonTypes
- Returns:
- List of BSON types to generate explicit MongoUnit BSON type specification. The
specification is based on the names (not values) of the
BsonTypeenum.
-
getMongoUnitValueFieldNameIndicator
- Returns:
- Field name to use as an indicator in developer JSON files to signify that a document is
a representation of a special MongoUnit value. The general format of the special name/value
pair is "$$BSON_TYPE": value If the JSON is meant to seed the database, 'BSON_TYPE' is to
specify a BSON type value based on the naming in
BsonType. If the JSON is meant to assert the expected result state, the format is allowed to be simply: "$$": value. In addition, a 'comparator' field is expected as a sibling field name.
-
setMongoClientURI
public void setMongoClientURI(com.mongodb.MongoClientURI mongoClientURI) - Parameters:
mongoClientURI- Validated URI of the mongo DB to connect to.
-
setCollectionNames
- Parameters:
collectionNames- Optional list of collection names to generate data based on.
-
setOutputPath
- Parameters:
outputPath- Absolute path to file where to output JSON.
-
setPreserveBsonTypes
- Parameters:
preserveBsonTypes- List of BSON types to generate explicit MongoUnit BSON type specification. The specification is based on the names (not values) of theBsonTypeenum.
-
setMongoUnitValueFieldNameIndicator
- Parameters:
mongoUnitValueFieldNameIndicator- Field name to use as an indicator in developer JSON files to signify that a document is a representation of a special MongoUnit value. The general format of the special name/value pair is "$$BSON_TYPE": value If the JSON is meant to seed the database, 'BSON_TYPE' is to specify a BSON type value based on the naming inBsonType. If the JSON is meant to assert the expected result state, the format is allowed to be simply: "$$": value. In addition, a 'comparator' field is expected as a sibling field name.
-
equals
-
hashCode
public int hashCode() -
toString
-