=======
This plugin provides task for generating hollow consumer api, that is described here
In order to use, add plugin dependency to your buildscript
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.netflix.nebula:nebula-hollow-plugin:1.+"
}
}
apply it
apply plugin: 'nebula.hollow'
and configure (you have to specify all the three values to work)
hollow {
packagesToScan = ['org.example.data', 'org.example.other.data']
apiClassName = 'MyApi'
apiPackageName = 'org.example.consumer.api'
}
where:
packagesToScan- packages with your data classes, note that scan is recursiveapiClassName- class name for your api implementationapiPackageName- target package in your project for api-related sources
optional values:
getterPrefix- prefix for getter methods. Ex._getId()classPostfix- postfix for classes. Ex.MovieHollow.javausePackageGrouping- will create Hollow artifacts separated by sub-packages: index, core, collectionsparameterizeAllClassNames- if true, all methods which return a Hollow Object will be parameterized. This is useful when alternate implementations are desired for some types. defaults totrueuseAggressiveSubstitutions- override generated classnames for type names corresponding to any class in the java.lang package. For more details please refer toHollowCodeGenerationUtils. defaults totrueuseErgonomicShortcuts- generates API shortcuts. For more details please refer toHollowErgonomicAPIShortcutsTest. defaults totruereservePrimaryKeyIndexForTypeWithPrimaryKey- specify to only generate PrimaryKeyIndex for Types that has PrimaryKey defined. defaults totrueuseHollowPrimitiveTypes- specify to use Hollow Primitive Types instead of generating them per project. defaults totruerestrictApiToFieldType- api code only generatesget<FieldName>with return type as per schema. defaults totrueuseVerboseToString- will implementtoString()method for hollow objects withHollowRecordStringifier().stringify(this). defaults totrueuseGeneratedAnnotation- addscom.netflix.hollow.HollowGeneratedannotation on generated classes. Defaults tofalse
For more information, please refer to AbstractHollowAPIGeneratorBuilder
launch task:
gradle generateHollowConsumerApi