Skip to content

Instantly share code, notes, and snippets.

@SpringBootApplication
@Log4j
class LambdaHandler implements RequestHandler<Map, Response> {
@Memoized
ApplicationContext getApplicationContext(String[] args = []) {
return SpringApplication.run(LambdaHandler.class, args)
}
@Override
plugins {
id 'org.springframework.boot' version '1.5.2.RELEASE'
}
apply plugin: 'groovy'
repositories {
jcenter()
mavenCentral()
}
@bytekast
bytekast / serverless.yml
Last active September 22, 2017 09:32
Serverless with Spring Boot / Spring Data
service: springboot-lambda
provider:
name: aws
runtime: java8
memorySize: 1536
timeout: 60
package:
artifact: build/distributions/springboot-lambda.zip
if ( modelAnnotation.isMeasure() ) {
ModelAnnotation<Measure> measureAnnotation = (ModelAnnotation<Measure>) modelAnnotation;
}
List<ModelAnnotation<?>> annotations = new ArrayList<ModelAnnotation<?>>();
annotations.add( new ModelAnnotation<Measure>( "field1", new Measure() ) );
annotations.add( new ModelAnnotation<Attribute>( "field2", new Attribute() ) );
annotations.add( new ModelAnnotation<Dimension>( "field2", new Dimension() ) );
annotations.add( new ModelAnnotation<HierarchyLevel>( "field3", new HierarchyLevel() ) );
annotations.add( new ModelAnnotation<Measure>( "field4", new Measure() ) );
for ( ModelAnnotation<?> modelAnnotation : annotations ) {
// do something with modelAnnotation - what is it? a measure, dimension, etc....
}