=======
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.java
usePackageGrouping
- 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 totrue
useAggressiveSubstitutions
- override generated classnames for type names corresponding to any class in the java.lang package. For more details please refer toHollowCodeGenerationUtils
. defaults totrue
useErgonomicShortcuts
- generates API shortcuts. For more details please refer toHollowErgonomicAPIShortcutsTest
. defaults totrue
reservePrimaryKeyIndexForTypeWithPrimaryKey
- specify to only generate PrimaryKeyIndex for Types that has PrimaryKey defined. defaults totrue
useHollowPrimitiveTypes
- specify to use Hollow Primitive Types instead of generating them per project. defaults totrue
restrictApiToFieldType
- api code only generatesget<FieldName>
with return type as per schema. defaults totrue
useVerboseToString
- will implementtoString()
method for hollow objects withHollowRecordStringifier().stringify(this)
. defaults totrue
For more information, please refer to AbstractHollowAPIGeneratorBuilder
launch task:
gradle generateHollowConsumerApi