Skip to content

Commit 2dbc59d

Browse files
committed
groovy does not support default methods
1 parent ba0f890 commit 2dbc59d

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

  • src/main/groovy/com/github/hauner/openapi/spring/model/datatypes

src/main/groovy/com/github/hauner/openapi/spring/model/datatypes/DataType.groovy

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,42 @@ package com.github.hauner.openapi.spring.model.datatypes
2121
*
2222
* @author Martin Hauner
2323
*/
24-
interface DataType {
24+
trait /*interface*/ DataType {
2525

2626
/**
2727
* The Java type name without package.
2828
*
2929
* @return the type name.
3030
*/
31-
String getName ()
31+
abstract String getName ()
3232

3333
/**
3434
* The package of this type without class.
3535
*/
36-
String getPackageName ()
36+
abstract String getPackageName ()
3737

3838
/**
3939
* Provides the import(s) of this type, usually a single import. If it is a generic type it will
4040
* add another import for each generic parameter.
4141
*
4242
* @return import of this type.
4343
*/
44-
Set<String> getImports ()
44+
abstract Set<String> getImports ()
4545

4646
/**
4747
* Provides the list of imports for the types referenced by this this type.
4848
*
4949
* @return the referenced import list.
5050
*/
51-
Set<String> getReferencedImports ()
51+
abstract Set<String> getReferencedImports ()
52+
53+
/**
54+
* Provides the constraint information of the data type.
55+
*
56+
* @return the constraints or null if there are no constraints.
57+
*/
58+
DataTypeConstraints getConstraints() {
59+
null
60+
}
61+
5262
}

0 commit comments

Comments
 (0)