Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦境迷离
Graphql Java Codegen
提交
02a61d4a
G
Graphql Java Codegen
项目概览
梦境迷离
/
Graphql Java Codegen
10 个月 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Graphql Java Codegen
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
02a61d4a
编写于
4月 25, 2020
作者:
B
Bogdan Kobylynskyi
提交者:
GitHub
4月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid unused imports #103 (#118)
上级
3452348b
变更
95
隐藏空白更改
内联
并排
Showing
95 changed file
with
210 addition
and
308 deletion
+210
-308
src/main/java/com/kobylynskyi/graphql/codegen/mapper/DefaultValueMapper.java
...obylynskyi/graphql/codegen/mapper/DefaultValueMapper.java
+2
-2
src/main/java/com/kobylynskyi/graphql/codegen/mapper/EnumDefinitionToDataModelMapper.java
...aphql/codegen/mapper/EnumDefinitionToDataModelMapper.java
+2
-4
src/main/java/com/kobylynskyi/graphql/codegen/mapper/FieldDefinitionToRequestDataModelMapper.java
...degen/mapper/FieldDefinitionToRequestDataModelMapper.java
+2
-3
src/main/java/com/kobylynskyi/graphql/codegen/mapper/FieldDefinitionsToResolverDataModelMapper.java
...gen/mapper/FieldDefinitionsToResolverDataModelMapper.java
+1
-1
src/main/java/com/kobylynskyi/graphql/codegen/mapper/GraphqlTypeToJavaTypeMapper.java
...i/graphql/codegen/mapper/GraphqlTypeToJavaTypeMapper.java
+2
-2
src/main/java/com/kobylynskyi/graphql/codegen/mapper/InputDefinitionToDataModelMapper.java
...phql/codegen/mapper/InputDefinitionToDataModelMapper.java
+2
-4
src/main/java/com/kobylynskyi/graphql/codegen/mapper/InterfaceDefinitionToDataModelMapper.java
.../codegen/mapper/InterfaceDefinitionToDataModelMapper.java
+4
-6
src/main/java/com/kobylynskyi/graphql/codegen/mapper/MapperUtils.java
...a/com/kobylynskyi/graphql/codegen/mapper/MapperUtils.java
+1
-44
src/main/java/com/kobylynskyi/graphql/codegen/mapper/TypeDefinitionToDataModelMapper.java
...aphql/codegen/mapper/TypeDefinitionToDataModelMapper.java
+4
-7
src/main/java/com/kobylynskyi/graphql/codegen/mapper/UnionDefinitionToDataModelMapper.java
...phql/codegen/mapper/UnionDefinitionToDataModelMapper.java
+2
-3
src/main/java/com/kobylynskyi/graphql/codegen/model/ParameterDefinition.java
...obylynskyi/graphql/codegen/model/ParameterDefinition.java
+2
-1
src/main/resources/templates/javaClassGraphqlInterface.ftl
src/main/resources/templates/javaClassGraphqlInterface.ftl
+2
-0
src/main/resources/templates/javaClassGraphqlRequest.ftl
src/main/resources/templates/javaClassGraphqlRequest.ftl
+7
-3
src/main/resources/templates/javaClassGraphqlResponseProjection.ftl
...esources/templates/javaClassGraphqlResponseProjection.ftl
+5
-3
src/main/resources/templates/javaClassGraphqlType.ftl
src/main/resources/templates/javaClassGraphqlType.ftl
+12
-1
src/main/resources/templates/javaClassGraphqlUnion.ftl
src/main/resources/templates/javaClassGraphqlUnion.ftl
+0
-3
src/test/java/com/kobylynskyi/graphql/codegen/GraphQLCodegenTest.java
...a/com/kobylynskyi/graphql/codegen/GraphQLCodegenTest.java
+9
-11
src/test/resources/expected-classes/AcceptTopicSuggestionPayloadResolver.java.txt
...ted-classes/AcceptTopicSuggestionPayloadResolver.java.txt
+1
-3
src/test/resources/expected-classes/CommentDeletedEvent.java.txt
...t/resources/expected-classes/CommentDeletedEvent.java.txt
+0
-1
src/test/resources/expected-classes/CommentDeletedEventResolver.java.txt
...ces/expected-classes/CommentDeletedEventResolver.java.txt
+0
-1
src/test/resources/expected-classes/Commit.java.txt
src/test/resources/expected-classes/Commit.java.txt
+0
-1
src/test/resources/expected-classes/CommitResolver.java.txt
src/test/resources/expected-classes/CommitResolver.java.txt
+6
-8
src/test/resources/expected-classes/Commit_noParametrizedFields.java.txt
...ces/expected-classes/Commit_noParametrizedFields.java.txt
+0
-1
src/test/resources/expected-classes/Commit_noValidationAnnotation.java.txt
...s/expected-classes/Commit_noValidationAnnotation.java.txt
+0
-1
src/test/resources/expected-classes/CreateEventMutation.java.txt
...t/resources/expected-classes/CreateEventMutation.java.txt
+0
-1
src/test/resources/expected-classes/EmptyMutation.java.txt
src/test/resources/expected-classes/EmptyMutation.java.txt
+0
-1
src/test/resources/expected-classes/EmptyQuery.java.txt
src/test/resources/expected-classes/EmptyQuery.java.txt
+0
-1
src/test/resources/expected-classes/Event.java.txt
src/test/resources/expected-classes/Event.java.txt
+6
-7
src/test/resources/expected-classes/EventByIdQuery.java.txt
src/test/resources/expected-classes/EventByIdQuery.java.txt
+0
-1
src/test/resources/expected-classes/EventProperty.java.txt
src/test/resources/expected-classes/EventProperty.java.txt
+6
-7
src/test/resources/expected-classes/EventPropertyTO_toString.java.txt
...ources/expected-classes/EventPropertyTO_toString.java.txt
+7
-7
src/test/resources/expected-classes/EventPropertyTO_withEqualsAndHashCode.java.txt
...ed-classes/EventPropertyTO_withEqualsAndHashCode.java.txt
+7
-7
src/test/resources/expected-classes/Event_noBuilder.java.txt
src/test/resources/expected-classes/Event_noBuilder.java.txt
+4
-5
src/test/resources/expected-classes/EventsByCategoryAndStatusQuery.java.txt
.../expected-classes/EventsByCategoryAndStatusQuery.java.txt
+1
-2
src/test/resources/expected-classes/EventsByIdsQuery.java.txt
...test/resources/expected-classes/EventsByIdsQuery.java.txt
+1
-2
src/test/resources/expected-classes/EventsCreatedSubscription.java.txt
...urces/expected-classes/EventsCreatedSubscription.java.txt
+1
-2
src/test/resources/expected-classes/GithubAcceptTopicSuggestionInputTO.java.txt
...ected-classes/GithubAcceptTopicSuggestionInputTO.java.txt
+0
-1
src/test/resources/expected-classes/GithubAcceptTopicSuggestionPayloadTO.java.txt
...ted-classes/GithubAcceptTopicSuggestionPayloadTO.java.txt
+0
-1
src/test/resources/expected-classes/GithubCommitTO.java.txt
src/test/resources/expected-classes/GithubCommitTO.java.txt
+0
-1
src/test/resources/expected-classes/InputWithDefaults.java.txt
...est/resources/expected-classes/InputWithDefaults.java.txt
+16
-17
src/test/resources/expected-classes/Mutation.java.txt
src/test/resources/expected-classes/Mutation.java.txt
+0
-1
src/test/resources/expected-classes/MyUnion.java.txt
src/test/resources/expected-classes/MyUnion.java.txt
+0
-1
src/test/resources/expected-classes/ProfileOwner.java.txt
src/test/resources/expected-classes/ProfileOwner.java.txt
+0
-1
src/test/resources/expected-classes/Query.java.txt
src/test/resources/expected-classes/Query.java.txt
+2
-3
src/test/resources/expected-classes/SomeObject.java.txt
src/test/resources/expected-classes/SomeObject.java.txt
+0
-1
src/test/resources/expected-classes/Subscription.java.txt
src/test/resources/expected-classes/Subscription.java.txt
+1
-2
src/test/resources/expected-classes/UnionMember1.java.txt
src/test/resources/expected-classes/UnionMember1.java.txt
+0
-1
src/test/resources/expected-classes/UnionMember2.java.txt
src/test/resources/expected-classes/UnionMember2.java.txt
+0
-1
src/test/resources/expected-classes/VersionQuery.java.txt
src/test/resources/expected-classes/VersionQuery.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/CreateEventMutation.java.txt
.../expected-classes/deprecated/CreateEventMutation.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/Event.java.txt
...test/resources/expected-classes/deprecated/Event.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/EventInput.java.txt
...resources/expected-classes/deprecated/EventInput.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/EventsQuery.java.txt
...esources/expected-classes/deprecated/EventsQuery.java.txt
+1
-2
src/test/resources/expected-classes/deprecated/Mutation.java.txt
...t/resources/expected-classes/deprecated/Mutation.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/Node.java.txt
src/test/resources/expected-classes/deprecated/Node.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/PinnableItem.java.txt
...sources/expected-classes/deprecated/PinnableItem.java.txt
+0
-1
src/test/resources/expected-classes/deprecated/Query.java.txt
...test/resources/expected-classes/deprecated/Query.java.txt
+1
-2
src/test/resources/expected-classes/extend-with-resolvers/Asset.java.txt
...ces/expected-classes/extend-with-resolvers/Asset.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/AssetInput.java.txt
...xpected-classes/extend-with-resolvers/AssetInput.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/AssetsQuery.java.txt
...pected-classes/extend-with-resolvers/AssetsQuery.java.txt
+1
-3
src/test/resources/expected-classes/extend-with-resolvers/CreateAssetMutation.java.txt
...lasses/extend-with-resolvers/CreateAssetMutation.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/CreateEventMutation.java.txt
...lasses/extend-with-resolvers/CreateEventMutation.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/Event.java.txt
...ces/expected-classes/extend-with-resolvers/Event.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/EventInput.java.txt
...xpected-classes/extend-with-resolvers/EventInput.java.txt
+6
-8
src/test/resources/expected-classes/extend-with-resolvers/EventResolver.java.txt
...cted-classes/extend-with-resolvers/EventResolver.java.txt
+1
-3
src/test/resources/expected-classes/extend-with-resolvers/EventsQuery.java.txt
...pected-classes/extend-with-resolvers/EventsQuery.java.txt
+1
-3
src/test/resources/expected-classes/extend-with-resolvers/Mutation.java.txt
.../expected-classes/extend-with-resolvers/Mutation.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/Node.java.txt
...rces/expected-classes/extend-with-resolvers/Node.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/NodeResolver.java.txt
...ected-classes/extend-with-resolvers/NodeResolver.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/PinnableItem.java.txt
...ected-classes/extend-with-resolvers/PinnableItem.java.txt
+0
-2
src/test/resources/expected-classes/extend-with-resolvers/Query.java.txt
...ces/expected-classes/extend-with-resolvers/Query.java.txt
+2
-4
src/test/resources/expected-classes/extend/Asset.java.txt
src/test/resources/expected-classes/extend/Asset.java.txt
+0
-2
src/test/resources/expected-classes/extend/AssetInput.java.txt
...est/resources/expected-classes/extend/AssetInput.java.txt
+0
-2
src/test/resources/expected-classes/extend/AssetsQuery.java.txt
...st/resources/expected-classes/extend/AssetsQuery.java.txt
+1
-3
src/test/resources/expected-classes/extend/CreateAssetMutation.java.txt
...rces/expected-classes/extend/CreateAssetMutation.java.txt
+0
-2
src/test/resources/expected-classes/extend/CreateEventMutation.java.txt
...rces/expected-classes/extend/CreateEventMutation.java.txt
+0
-2
src/test/resources/expected-classes/extend/Event.java.txt
src/test/resources/expected-classes/extend/Event.java.txt
+6
-8
src/test/resources/expected-classes/extend/EventInput.java.txt
...est/resources/expected-classes/extend/EventInput.java.txt
+6
-8
src/test/resources/expected-classes/extend/EventsQuery.java.txt
...st/resources/expected-classes/extend/EventsQuery.java.txt
+1
-3
src/test/resources/expected-classes/extend/Mutation.java.txt
src/test/resources/expected-classes/extend/Mutation.java.txt
+0
-2
src/test/resources/expected-classes/extend/Node.java.txt
src/test/resources/expected-classes/extend/Node.java.txt
+0
-2
src/test/resources/expected-classes/extend/PinnableItem.java.txt
...t/resources/expected-classes/extend/PinnableItem.java.txt
+0
-2
src/test/resources/expected-classes/extend/Query.java.txt
src/test/resources/expected-classes/extend/Query.java.txt
+2
-4
src/test/resources/expected-classes/extend/request/AssetResponseProjection.java.txt
...d-classes/extend/request/AssetResponseProjection.java.txt
+5
-2
src/test/resources/expected-classes/extend/request/EventResponseProjection.java.txt
...d-classes/extend/request/EventResponseProjection.java.txt
+5
-2
src/test/resources/expected-classes/request/AcceptTopicSuggestionInput.java.txt
...ected-classes/request/AcceptTopicSuggestionInput.java.txt
+5
-4
src/test/resources/expected-classes/request/CodeOfConductResponseProjection.java.txt
...-classes/request/CodeOfConductResponseProjection.java.txt
+5
-2
src/test/resources/expected-classes/request/EventPropertyResponseProjection.java.txt
...-classes/request/EventPropertyResponseProjection.java.txt
+5
-2
src/test/resources/expected-classes/request/EventResponseProjection.java.txt
...expected-classes/request/EventResponseProjection.java.txt
+5
-2
src/test/resources/expected-classes/request/EventsByCategoryAndStatusQueryRequest.java.txt
...es/request/EventsByCategoryAndStatusQueryRequest.java.txt
+5
-2
src/test/resources/expected-classes/request/EventsByCategoryAndStatusQueryRequest_withApiImport.java.txt
...ntsByCategoryAndStatusQueryRequest_withApiImport.java.txt
+5
-3
src/test/resources/expected-classes/request/EventsByCategoryAndStatusQueryRequest_withModelSuffix.java.txt
...sByCategoryAndStatusQueryRequest_withModelSuffix.java.txt
+5
-2
src/test/resources/expected-classes/request/EventsByIdsQueryRequest.java.txt
...expected-classes/request/EventsByIdsQueryRequest.java.txt
+8
-5
src/test/resources/expected-classes/request/UpdateRepositoryMutationRequest.java.txt
...-classes/request/UpdateRepositoryMutationRequest.java.txt
+5
-2
src/test/resources/expected-classes/request/VersionQueryRequest.java.txt
...ces/expected-classes/request/VersionQueryRequest.java.txt
+5
-2
未找到文件。
src/main/java/com/kobylynskyi/graphql/codegen/mapper/DefaultValueMapper.java
浏览文件 @
02a61d4a
...
...
@@ -77,11 +77,11 @@ public class DefaultValueMapper {
}
List
<
Value
>
values
=
defaultValue
.
getValues
();
if
(
values
.
isEmpty
())
{
return
"Collections.emptyList()"
;
return
"
java.util.
Collections.emptyList()"
;
}
Type
<?>
elementType
=
((
ListType
)
graphQLType
).
getType
();
return
values
.
stream
()
.
map
(
v
->
map
(
v
,
elementType
))
.
collect
(
Collectors
.
joining
(
", "
,
"Arrays.asList("
,
")"
));
.
collect
(
Collectors
.
joining
(
", "
,
"
java.util.
Arrays.asList("
,
")"
));
}
}
src/main/java/com/kobylynskyi/graphql/codegen/mapper/EnumDefinitionToDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -27,11 +27,9 @@ public class EnumDefinitionToDataModelMapper {
* @return Freemarker data model of the GraphQL enum
*/
public
static
Map
<
String
,
Object
>
map
(
MappingConfig
mappingConfig
,
ExtendedEnumTypeDefinition
definition
)
{
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImports
(
mappingConfig
,
packageName
));
// type/enum/input/interface/union classes do not require any imports
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
MapperUtils
.
getClassNameWithPrefixAndSuffix
(
mappingConfig
,
definition
));
dataModel
.
put
(
JAVA_DOC
,
definition
.
getJavaDoc
());
dataModel
.
put
(
FIELDS
,
map
(
definition
.
getValueDefinitions
()));
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/FieldDefinitionToRequestDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -29,9 +29,8 @@ public class FieldDefinitionToRequestDataModelMapper {
ExtendedFieldDefinition
operationDef
,
String
objectTypeName
)
{
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImportsForRequests
(
mappingConfig
,
packageName
));
// Request classes are sharing the package with the model classes, so no imports are needed
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
getClassName
(
operationDef
.
getName
(),
objectTypeName
,
mappingConfig
.
getRequestSuffix
()));
dataModel
.
put
(
JAVA_DOC
,
operationDef
.
getJavaDoc
());
dataModel
.
put
(
OPERATION_NAME
,
operationDef
.
getName
());
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/FieldDefinitionsToResolverDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -75,7 +75,7 @@ public class FieldDefinitionsToResolverDataModelMapper {
List
<
ExtendedFieldDefinition
>
fieldDefinitions
,
List
<
String
>
javaDoc
)
{
String
packageName
=
MapperUtils
.
getApiPackageName
(
mappingConfig
);
Set
<
String
>
imports
=
MapperUtils
.
getImports
ForFieldResolvers
(
mappingConfig
,
packageName
,
parentTyp
eName
);
Set
<
String
>
imports
=
MapperUtils
.
getImports
(
mappingConfig
,
packag
eName
);
List
<
OperationDefinition
>
operations
=
mapToOperations
(
mappingConfig
,
fieldDefinitions
,
parentTypeName
);
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/GraphqlTypeToJavaTypeMapper.java
浏览文件 @
02a61d4a
...
...
@@ -142,7 +142,7 @@ class GraphqlTypeToJavaTypeMapper {
* @return String wrapped into Collection<>
*/
private
static
String
wrapIntoJavaCollection
(
String
type
)
{
return
String
.
format
(
"Collection<%s>"
,
type
);
return
String
.
format
(
"
java.util.
Collection<%s>"
,
type
);
}
/**
...
...
@@ -152,7 +152,7 @@ class GraphqlTypeToJavaTypeMapper {
* @return String wrapped into CompletableFuture<>
*/
private
static
String
wrapIntoJavaCompletableFuture
(
String
type
)
{
return
String
.
format
(
"CompletableFuture<%s>"
,
type
);
return
String
.
format
(
"
java.util.concurrent.
CompletableFuture<%s>"
,
type
);
}
/**
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/InputDefinitionToDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -23,11 +23,9 @@ public class InputDefinitionToDataModelMapper {
* @return Freemarker data model of the GraphQL type
*/
public
static
Map
<
String
,
Object
>
map
(
MappingConfig
mappingConfig
,
ExtendedInputObjectTypeDefinition
definition
)
{
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImports
(
mappingConfig
,
packageName
));
// type/enum/input/interface/union classes do not require any imports
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
MapperUtils
.
getClassNameWithPrefixAndSuffix
(
mappingConfig
,
definition
));
dataModel
.
put
(
JAVA_DOC
,
definition
.
getJavaDoc
());
dataModel
.
put
(
NAME
,
definition
.
getName
());
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/InterfaceDefinitionToDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -25,15 +25,13 @@ public class InterfaceDefinitionToDataModelMapper {
* @return Freemarker data model of the GraphQL interface
*/
public
static
Map
<
String
,
Object
>
map
(
MappingConfig
mappingConfig
,
ExtendedInterfaceTypeDefinition
definition
)
{
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
List
<
ExtendedFieldDefinition
>
fieldDefinitions
=
definition
.
getFieldDefinitions
();
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImports
(
mappingConfig
,
packageName
));
// type/enum/input/interface/union classes do not require any imports
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
MapperUtils
.
getClassNameWithPrefixAndSuffix
(
mappingConfig
,
definition
));
dataModel
.
put
(
JAVA_DOC
,
definition
.
getJavaDoc
());
dataModel
.
put
(
FIELDS
,
FieldDefinitionToParameterMapper
.
mapFields
(
mappingConfig
,
fieldDefinitions
,
definition
.
getName
()));
dataModel
.
put
(
FIELDS
,
FieldDefinitionToParameterMapper
.
mapFields
(
mappingConfig
,
definition
.
getFieldDefinitions
(),
definition
.
getName
()));
return
dataModel
;
}
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/MapperUtils.java
浏览文件 @
02a61d4a
...
...
@@ -96,9 +96,7 @@ class MapperUtils {
/**
* Returns imports required for a generated class:
* - model package name
* - api package name
* - generic package name
* - java.util
*
* @param mappingConfig Global mapping configuration
* @param packageName Package name of the generated class which will be ignored
...
...
@@ -110,52 +108,11 @@ class MapperUtils {
if
(!
Utils
.
isBlank
(
modelPackageName
)
&&
!
modelPackageName
.
equals
(
packageName
))
{
imports
.
add
(
modelPackageName
);
}
String
apiPackageName
=
mappingConfig
.
getApiPackageName
();
if
(!
Utils
.
isBlank
(
apiPackageName
)
&&
!
apiPackageName
.
equals
(
packageName
)
&&
apisOrResolversAreGenerated
(
mappingConfig
))
{
imports
.
add
(
apiPackageName
);
}
String
genericPackageName
=
mappingConfig
.
getPackageName
();
if
(!
Utils
.
isBlank
(
genericPackageName
)
&&
!
genericPackageName
.
equals
(
packageName
))
{
imports
.
add
(
genericPackageName
);
}
imports
.
add
(
"java.util"
);
return
imports
;
}
private
static
boolean
apisOrResolversAreGenerated
(
MappingConfig
mappingConfig
)
{
return
mappingConfig
.
getGenerateApis
()
||
!
mappingConfig
.
getFieldsWithResolvers
().
isEmpty
()
||
mappingConfig
.
getGenerateExtensionFieldsResolvers
();
}
/**
* Returns imports required for the fields resolvers class
*
* @param mappingConfig Global mapping configuration
* @param packageName Package name of the generated class which will be ignored
* @return all imports required for a generated class
*/
static
Set
<
String
>
getImportsForFieldResolvers
(
MappingConfig
mappingConfig
,
String
packageName
,
String
objectTypeName
)
{
Set
<
String
>
imports
=
getImports
(
mappingConfig
,
packageName
);
if
(
mappingConfig
.
getGenerateDataFetchingEnvironmentArgumentInApis
())
{
imports
.
add
(
"graphql.schema"
);
}
if
(
shouldUseAsyncMethods
(
mappingConfig
,
objectTypeName
))
{
imports
.
add
(
"java.util.concurrent"
);
}
return
imports
;
}
/**
* Returns imports required for the request class.
*
* @param mappingConfig Global mapping configuration
* @param packageName Package name of the generated class which will be ignored
* @return all imports required for a generated request class
*/
static
Set
<
String
>
getImportsForRequests
(
MappingConfig
mappingConfig
,
String
packageName
)
{
Set
<
String
>
imports
=
getImports
(
mappingConfig
,
packageName
);
imports
.
add
(
GraphQLOperation
.
class
.
getPackage
().
getName
());
// not adding apiPackageName because it should not be imported in any other generated classes
return
imports
;
}
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/TypeDefinitionToDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -33,11 +33,9 @@ public class TypeDefinitionToDataModelMapper {
public
static
Map
<
String
,
Object
>
map
(
MappingConfig
mappingConfig
,
ExtendedObjectTypeDefinition
definition
,
ExtendedDocument
document
)
{
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImports
(
mappingConfig
,
packageName
));
// type/enum/input/interface/union classes do not require any imports
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
MapperUtils
.
getClassNameWithPrefixAndSuffix
(
mappingConfig
,
definition
));
dataModel
.
put
(
JAVA_DOC
,
definition
.
getJavaDoc
());
dataModel
.
put
(
IMPLEMENTS
,
getInterfaces
(
mappingConfig
,
definition
,
document
));
...
...
@@ -63,9 +61,8 @@ public class TypeDefinitionToDataModelMapper {
ExtendedDocument
document
,
Set
<
String
>
typeNames
)
{
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImportsForRequests
(
mappingConfig
,
packageName
));
// ResponseProjection classes are sharing the package with the model classes, so no imports are needed
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
Utils
.
capitalize
(
typeDefinition
.
getName
())
+
mappingConfig
.
getResponseProjectionSuffix
());
dataModel
.
put
(
JAVA_DOC
,
Collections
.
singletonList
(
"Response projection for "
+
typeDefinition
.
getName
()));
dataModel
.
put
(
FIELDS
,
getProjectionFields
(
mappingConfig
,
typeDefinition
,
document
,
typeNames
));
...
...
src/main/java/com/kobylynskyi/graphql/codegen/mapper/UnionDefinitionToDataModelMapper.java
浏览文件 @
02a61d4a
...
...
@@ -24,9 +24,8 @@ public class UnionDefinitionToDataModelMapper {
*/
public
static
Map
<
String
,
Object
>
map
(
MappingConfig
mappingConfig
,
ExtendedUnionTypeDefinition
definition
)
{
Map
<
String
,
Object
>
dataModel
=
new
HashMap
<>();
String
packageName
=
MapperUtils
.
getModelPackageName
(
mappingConfig
);
dataModel
.
put
(
PACKAGE
,
packageName
);
dataModel
.
put
(
IMPORTS
,
MapperUtils
.
getImports
(
mappingConfig
,
packageName
));
// type/enum/input/interface/union classes do not require any imports
dataModel
.
put
(
PACKAGE
,
MapperUtils
.
getModelPackageName
(
mappingConfig
));
dataModel
.
put
(
CLASS_NAME
,
MapperUtils
.
getClassNameWithPrefixAndSuffix
(
mappingConfig
,
definition
));
dataModel
.
put
(
JAVA_DOC
,
definition
.
getJavaDoc
());
return
dataModel
;
...
...
src/main/java/com/kobylynskyi/graphql/codegen/model/ParameterDefinition.java
浏览文件 @
02a61d4a
package
com.kobylynskyi.graphql.codegen.model
;
import
graphql.schema.DataFetchingEnvironment
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -20,7 +21,7 @@ import static java.util.Collections.emptyList;
public
class
ParameterDefinition
{
public
static
final
ParameterDefinition
DATA_FETCHING_ENVIRONMENT
=
new
ParameterDefinition
(
"DataFetchingEnvironment"
,
"env"
,
null
,
emptyList
(),
emptyList
(),
false
);
DataFetchingEnvironment
.
class
.
getName
()
,
"env"
,
null
,
emptyList
(),
emptyList
(),
false
);
private
String
type
;
private
String
name
;
...
...
src/main/resources/templates/javaClassGraphqlInterface.ftl
浏览文件 @
02a61d4a
...
...
@@ -2,9 +2,11 @@
package
${
package
};
</#
if
>
<#
if
imports
??>
<#
list
imports
as
import
>
import
${
import
}.*;
</#
list
>
</#
if
>
<#
if
javaDoc
?
has_content
>
/**
...
...
src/main/resources/templates/javaClassGraphqlRequest.ftl
浏览文件 @
02a61d4a
...
...
@@ -2,9 +2,13 @@
package
${
package
};
</#
if
>
<#
list
imports
as
import
>
import
${
import
}.*;
</#
list
>
import
com
.
kobylynskyi
.
graphql
.
codegen
.
model
.
graphql
.
GraphQLOperation
;
import
com
.
kobylynskyi
.
graphql
.
codegen
.
model
.
graphql
.
GraphQLOperationRequest
;
import
java
.
util
.
LinkedHashMap
;
import
java
.
util
.
Map
;
<#
if
toString
||
equalsAndHashCode
>
import
java
.
util
.
Objects
;
</#
if
>
<#
if
javaDoc
?
has_content
>
/**
...
...
src/main/resources/templates/javaClassGraphqlResponseProjection.ftl
浏览文件 @
02a61d4a
...
...
@@ -2,9 +2,11 @@
package
${
package
};
</#
if
>
<#
list
imports
as
import
>
import
${
import
}.*;
</#
list
>
import
com
.
kobylynskyi
.
graphql
.
codegen
.
model
.
graphql
.
GraphQLResponseProjection
;
import
java
.
util
.
LinkedHashMap
;
import
java
.
util
.
Map
;
import
java
.
util
.
Objects
;
import
java
.
util
.
StringJoiner
;
<#
if
javaDoc
?
has_content
>
/**
...
...
src/main/resources/templates/javaClassGraphqlType.ftl
浏览文件 @
02a61d4a
...
...
@@ -2,9 +2,20 @@
package
${
package
};
</#
if
>
<#
if
imports
??>
<#
list
imports
as
import
>
import
${
import
}.*;
</#
list
>
</#
if
>
<#
if
toStringEscapeJson
>
import
com
.
kobylynskyi
.
graphql
.
codegen
.
model
.
graphql
.
GraphQLRequestSerializer
;
</#
if
>
<#
if
equalsAndHashCode
>
import
java
.
util
.
Objects
;
</#
if
>
<#
if
toString
>
import
java
.
util
.
StringJoiner
;
</#
if
>
<#
if
javaDoc
?
has_content
>
/**
...
...
@@ -98,7 +109,7 @@ public class ${className} <#if implements?has_content>implements <#list implemen
if
(${
field
.
name
}
!= null) {
<#
if
field
.
type
==
"String"
>
<#
if
toStringEscapeJson
>
joiner
.
add
(
"${field.name}:
\"
"
+
com
.
kobylynskyi
.
graphql
.
codegen
.
model
.
graphql
.
GraphQLRequestSerializer
.
escapeJsonString
(${
field
.
name
})
+
"
\"
"
);
joiner
.
add
(
"${field.name}:
\"
"
+
GraphQLRequestSerializer
.
escapeJsonString
(${
field
.
name
})
+
"
\"
"
);
<#
else
>
joiner
.
add
(
"${field.name}:
\"
"
+
${
field
.
name
}
+
"
\"
"
);
</#
if
>
...
...
src/main/resources/templates/javaClassGraphqlUnion.ftl
浏览文件 @
02a61d4a
...
...
@@ -2,9 +2,6 @@
package
${
package
};
</#
if
>
<#
list
imports
as
import
>
import
${
import
}.*;
</#
list
>
<#
if
javaDoc
?
has_content
>
/**
...
...
src/test/java/com/kobylynskyi/graphql/codegen/GraphQLCodegenTest.java
浏览文件 @
02a61d4a
...
...
@@ -204,7 +204,7 @@ class GraphQLCodegenTest {
.
filter
(
file
->
file
.
getName
().
equalsIgnoreCase
(
"EventsCreatedSubscription.java"
)).
findFirst
()
.
orElseThrow
(
FileNotFoundException:
:
new
);
assertThat
(
Utils
.
getFileContent
(
eventFile
.
getPath
()),
StringContains
.
containsString
(
"org.reactivestreams.Publisher<Collection<Event>> eventsCreated() throws Exception;"
));
"org.reactivestreams.Publisher<
java.util.
Collection<Event>> eventsCreated() throws Exception;"
));
}
@Test
...
...
@@ -217,7 +217,7 @@ class GraphQLCodegenTest {
.
orElseThrow
(
FileNotFoundException:
:
new
);
assertThat
(
Utils
.
getFileContent
(
eventFile
.
getPath
()),
StringStartsWith
.
startsWith
(
"import java.util.*;"
+
System
.
lineSeparator
()
+
System
.
lineSeparator
()
+
System
.
lineSeparator
()
+
"/**"
+
System
.
lineSeparator
()
+
" * An event that describes a thing that happens"
+
System
.
lineSeparator
()
+
" */"
+
System
.
lineSeparator
()
+
...
...
@@ -384,16 +384,14 @@ class GraphQLCodegenTest {
File
[]
files
=
Objects
.
requireNonNull
(
outputJavaClassesDir
.
listFiles
());
String
importJavaUtilConcurrent
=
"import java.util.concurrent"
;
assertFileContainsElements
(
files
,
"VersionQuery.java"
,
"java.util.concurrent.CompletableFuture<String> version()"
);
assertFileContainsElements
(
files
,
"
VersionQuery.java"
,
importJavaUtilConcurrent
,
"
CompletableFuture<String> version()
"
);
assertFileContainsElements
(
files
,
"
EventsByCategoryAndStatusQuery.java"
,
"
java.util.concurrent.CompletableFuture<java.util.Collection<Event>> eventsByCategoryAndStatus(
"
);
assertFileContainsElements
(
files
,
"EventsByCategoryAndStatusQuery.java"
,
importJavaUtilConcurrent
,
"CompletableFuture<Collection<Event>> eventsByCategoryAndStatus("
);
assertFileContainsElements
(
files
,
"EventByIdQuery.java"
,
importJavaUtilConcurrent
,
"CompletableFuture<Event> eventById("
);
assertFileContainsElements
(
files
,
"EventByIdQuery.java"
,
"java.util.concurrent.CompletableFuture<Event> eventById("
);
}
...
...
@@ -405,7 +403,7 @@ class GraphQLCodegenTest {
File
[]
files
=
Objects
.
requireNonNull
(
outputJavaClassesDir
.
listFiles
());
assertFileContainsElements
(
files
,
"CreateEventMutation.java"
,
"
import java.util.concurrent"
,
"
CompletableFuture<Event> createEvent("
);
"
java.util.concurrent.
CompletableFuture<Event> createEvent("
);
}
...
...
src/test/resources/expected-classes/AcceptTopicSuggestionPayloadResolver.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import graphql.schema.*;
public interface AcceptTopicSuggestionPayloadResolver {
GithubTopicTO topic(GithubAcceptTopicSuggestionPayloadTO githubAcceptTopicSuggestionPayloadTO, DataFetchingEnvironment env) throws Exception;
GithubTopicTO topic(GithubAcceptTopicSuggestionPayloadTO githubAcceptTopicSuggestionPayloadTO,
graphql.schema.
DataFetchingEnvironment env) throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/CommentDeletedEvent.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class CommentDeletedEvent implements IssueTimelineItems, PullRequestTimelineItems, Node{
...
...
src/test/resources/expected-classes/CommentDeletedEventResolver.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public interface CommentDeletedEventResolver {
...
...
src/test/resources/expected-classes/Commit.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class Commit implements Closer, IssueTimelineItem, PullRequestTimelineItem, Subscribable, Node, GitObject, UniformResourceLocatable{
...
...
src/test/resources/expected-classes/CommitResolver.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import graphql.schema.*;
public interface CommitResolver {
PullRequestConnection associatedPullRequests(Commit commit, String after, String before, Integer first, Integer last, PullRequestOrder orderBy, DataFetchingEnvironment env) throws Exception;
PullRequestConnection associatedPullRequests(Commit commit, String after, String before, Integer first, Integer last, PullRequestOrder orderBy,
graphql.schema.
DataFetchingEnvironment env) throws Exception;
@javax.validation.constraints.NotNull
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.DateTimeScalarDeserializer.class)
Blame blame(Commit commit, String path, DataFetchingEnvironment env) throws Exception;
Blame blame(Commit commit, String path,
graphql.schema.
DataFetchingEnvironment env) throws Exception;
@javax.validation.constraints.NotNull
CommitCommentConnection comments(Commit commit, String after, String before, Integer first, Integer last, DataFetchingEnvironment env) throws Exception;
CommitCommentConnection comments(Commit commit, String after, String before, Integer first, Integer last,
graphql.schema.
DataFetchingEnvironment env) throws Exception;
DeploymentConnection deployments(Commit commit, String after, String before,
Collection<String> environments, Integer first, Integer last, DeploymentOrder orderBy,
DataFetchingEnvironment env) throws Exception;
DeploymentConnection deployments(Commit commit, String after, String before,
java.util.Collection<String> environments, Integer first, Integer last, DeploymentOrder orderBy, graphql.schema.
DataFetchingEnvironment env) throws Exception;
@javax.validation.constraints.NotNull
CommitHistoryConnection history(Commit commit, String after, CommitAuthor author, String before, Integer first, Integer last, String path, String since, String until, DataFetchingEnvironment env) throws Exception;
CommitHistoryConnection history(Commit commit, String after, CommitAuthor author, String before, Integer first, Integer last, String path, String since, String until,
graphql.schema.
DataFetchingEnvironment env) throws Exception;
@javax.validation.constraints.NotNull
CommitConnection parents(Commit commit, String after, String before, Integer first, Integer last, DataFetchingEnvironment env) throws Exception;
CommitConnection parents(Commit commit, String after, String before, Integer first, Integer last,
graphql.schema.
DataFetchingEnvironment env) throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/Commit_noParametrizedFields.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class Commit implements Closer, IssueTimelineItem, PullRequestTimelineItem, Subscribable, Node, GitObject, UniformResourceLocatable{
...
...
src/test/resources/expected-classes/Commit_noValidationAnnotation.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class Commit implements Closer, IssueTimelineItem, PullRequestTimelineItem, Subscribable, Node, GitObject, UniformResourceLocatable{
...
...
src/test/resources/expected-classes/CreateEventMutation.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface CreateEventMutation {
...
...
src/test/resources/expected-classes/EmptyMutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Mutation {
...
...
src/test/resources/expected-classes/EmptyQuery.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Query {
...
...
src/test/resources/expected-classes/Event.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
/**
* An event that describes a thing that happens
...
...
@@ -9,7 +8,7 @@ public class Event {
private String id;
private String categoryId;
private Collection<EventProperty> properties;
private
java.util.
Collection<EventProperty> properties;
private EventStatus status;
private String createdBy;
private String createdDateTime;
...
...
@@ -19,7 +18,7 @@ public class Event {
public Event() {
}
public Event(String id, String categoryId, Collection<EventProperty> properties, EventStatus status, String createdBy, String createdDateTime, Boolean active, Integer rating) {
public Event(String id, String categoryId,
java.util.
Collection<EventProperty> properties, EventStatus status, String createdBy, String createdDateTime, Boolean active, Integer rating) {
this.id = id;
this.categoryId = categoryId;
this.properties = properties;
...
...
@@ -44,10 +43,10 @@ public class Event {
this.categoryId = categoryId;
}
public Collection<EventProperty> getProperties() {
public
java.util.
Collection<EventProperty> getProperties() {
return properties;
}
public void setProperties(Collection<EventProperty> properties) {
public void setProperties(
java.util.
Collection<EventProperty> properties) {
this.properties = properties;
}
...
...
@@ -92,7 +91,7 @@ public class Event {
private String id;
private String categoryId;
private Collection<EventProperty> properties;
private
java.util.
Collection<EventProperty> properties;
private EventStatus status;
private String createdBy;
private String createdDateTime;
...
...
@@ -112,7 +111,7 @@ public class Event {
return this;
}
public Builder setProperties(Collection<EventProperty> properties) {
public Builder setProperties(
java.util.
Collection<EventProperty> properties) {
this.properties = properties;
return this;
}
...
...
src/test/resources/expected-classes/EventByIdQuery.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface EventByIdQuery {
...
...
src/test/resources/expected-classes/EventProperty.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
/**
* An event property have all possible types
...
...
@@ -11,13 +10,13 @@ public class EventProperty {
private Boolean booleanVal;
private Integer intVal;
private String stringVal;
private Collection<EventProperty> child;
private
java.util.
Collection<EventProperty> child;
private Event parent;
public EventProperty() {
}
public EventProperty(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal, Collection<EventProperty> child, Event parent) {
public EventProperty(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal,
java.util.
Collection<EventProperty> child, Event parent) {
this.floatVal = floatVal;
this.booleanVal = booleanVal;
this.intVal = intVal;
...
...
@@ -71,13 +70,13 @@ public class EventProperty {
/**
* Properties
*/
public Collection<EventProperty> getChild() {
public
java.util.
Collection<EventProperty> getChild() {
return child;
}
/**
* Properties
*/
public void setChild(Collection<EventProperty> child) {
public void setChild(
java.util.
Collection<EventProperty> child) {
this.child = child;
}
...
...
@@ -102,7 +101,7 @@ public class EventProperty {
private Boolean booleanVal;
private Integer intVal;
private String stringVal;
private Collection<EventProperty> child;
private
java.util.
Collection<EventProperty> child;
private Event parent;
public Builder() {
...
...
@@ -138,7 +137,7 @@ public class EventProperty {
/**
* Properties
*/
public Builder setChild(Collection<EventProperty> child) {
public Builder setChild(
java.util.
Collection<EventProperty> child) {
this.child = child;
return this;
}
...
...
src/test/resources/expected-classes/EventPropertyTO_toString.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.
*
;
import java.util.
StringJoiner
;
/**
* An event property have all possible types
...
...
@@ -11,13 +11,13 @@ public class EventPropertyTO {
private Boolean booleanVal;
private Integer intVal;
private String stringVal;
private Collection<EventPropertyTO> child;
private
java.util.
Collection<EventPropertyTO> child;
private EventTO parent;
public EventPropertyTO() {
}
public EventPropertyTO(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal, Collection<EventPropertyTO> child, EventTO parent) {
public EventPropertyTO(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal,
java.util.
Collection<EventPropertyTO> child, EventTO parent) {
this.floatVal = floatVal;
this.booleanVal = booleanVal;
this.intVal = intVal;
...
...
@@ -71,13 +71,13 @@ public class EventPropertyTO {
/**
* Properties
*/
public Collection<EventPropertyTO> getChild() {
public
java.util.
Collection<EventPropertyTO> getChild() {
return child;
}
/**
* Properties
*/
public void setChild(Collection<EventPropertyTO> child) {
public void setChild(
java.util.
Collection<EventPropertyTO> child) {
this.child = child;
}
...
...
@@ -125,7 +125,7 @@ public class EventPropertyTO {
private Boolean booleanVal;
private Integer intVal;
private String stringVal;
private Collection<EventPropertyTO> child;
private
java.util.
Collection<EventPropertyTO> child;
private EventTO parent;
public Builder() {
...
...
@@ -161,7 +161,7 @@ public class EventPropertyTO {
/**
* Properties
*/
public Builder setChild(Collection<EventPropertyTO> child) {
public Builder setChild(
java.util.
Collection<EventPropertyTO> child) {
this.child = child;
return this;
}
...
...
src/test/resources/expected-classes/EventPropertyTO_withEqualsAndHashCode.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.
*
;
import java.util.
Objects
;
/**
* An event property have all possible types
...
...
@@ -11,13 +11,13 @@ public class EventPropertyTO {
private Boolean booleanVal;
private Integer intVal;
private String stringVal;
private Collection<EventPropertyTO> child;
private
java.util.
Collection<EventPropertyTO> child;
private EventTO parent;
public EventPropertyTO() {
}
public EventPropertyTO(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal, Collection<EventPropertyTO> child, EventTO parent) {
public EventPropertyTO(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal,
java.util.
Collection<EventPropertyTO> child, EventTO parent) {
this.floatVal = floatVal;
this.booleanVal = booleanVal;
this.intVal = intVal;
...
...
@@ -71,13 +71,13 @@ public class EventPropertyTO {
/**
* Properties
*/
public Collection<EventPropertyTO> getChild() {
public
java.util.
Collection<EventPropertyTO> getChild() {
return child;
}
/**
* Properties
*/
public void setChild(Collection<EventPropertyTO> child) {
public void setChild(
java.util.
Collection<EventPropertyTO> child) {
this.child = child;
}
...
...
@@ -123,7 +123,7 @@ public class EventPropertyTO {
private Boolean booleanVal;
private Integer intVal;
private String stringVal;
private Collection<EventPropertyTO> child;
private
java.util.
Collection<EventPropertyTO> child;
private EventTO parent;
public Builder() {
...
...
@@ -159,7 +159,7 @@ public class EventPropertyTO {
/**
* Properties
*/
public Builder setChild(Collection<EventPropertyTO> child) {
public Builder setChild(
java.util.
Collection<EventPropertyTO> child) {
this.child = child;
return this;
}
...
...
src/test/resources/expected-classes/Event_noBuilder.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
/**
* An event that describes a thing that happens
...
...
@@ -9,7 +8,7 @@ public class Event {
private String id;
private String categoryId;
private Collection<EventProperty> properties;
private
java.util.
Collection<EventProperty> properties;
private EventStatus status;
private String createdBy;
private String createdDateTime;
...
...
@@ -19,7 +18,7 @@ public class Event {
public Event() {
}
public Event(String id, String categoryId, Collection<EventProperty> properties, EventStatus status, String createdBy, String createdDateTime, Boolean active, Integer rating) {
public Event(String id, String categoryId,
java.util.
Collection<EventProperty> properties, EventStatus status, String createdBy, String createdDateTime, Boolean active, Integer rating) {
this.id = id;
this.categoryId = categoryId;
this.properties = properties;
...
...
@@ -44,10 +43,10 @@ public class Event {
this.categoryId = categoryId;
}
public Collection<EventProperty> getProperties() {
public
java.util.
Collection<EventProperty> getProperties() {
return properties;
}
public void setProperties(Collection<EventProperty> properties) {
public void setProperties(
java.util.
Collection<EventProperty> properties) {
this.properties = properties;
}
...
...
src/test/resources/expected-classes/EventsByCategoryAndStatusQuery.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface EventsByCategoryAndStatusQuery {
...
...
@@ -8,6 +7,6 @@ public interface EventsByCategoryAndStatusQuery {
* List of events of a specified category.
*/
@javax.validation.constraints.NotNull
Collection<Event> eventsByCategoryAndStatus(String categoryId, EventStatus status) throws Exception;
java.util.
Collection<Event> eventsByCategoryAndStatus(String categoryId, EventStatus status) throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/EventsByIdsQuery.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface EventsByIdsQuery {
...
...
@@ -8,6 +7,6 @@ public interface EventsByIdsQuery {
* Events by IDs.
*/
@javax.validation.constraints.NotNull
Collection<Event> eventsByIds(
Collection<String> ids) throws Exception;
java.util.Collection<Event> eventsByIds(java.util.
Collection<String> ids) throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/EventsCreatedSubscription.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface EventsCreatedSubscription {
...
...
@@ -8,6 +7,6 @@ public interface EventsCreatedSubscription {
* Subscribe to events
*/
@javax.validation.constraints.NotNull
Collection<Event> eventsCreated() throws Exception;
java.util.
Collection<Event> eventsCreated() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/GithubAcceptTopicSuggestionInputTO.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class GithubAcceptTopicSuggestionInputTO {
...
...
src/test/resources/expected-classes/GithubAcceptTopicSuggestionPayloadTO.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class GithubAcceptTopicSuggestionPayloadTO {
...
...
src/test/resources/expected-classes/GithubCommitTO.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public class GithubCommitTO implements GithubCloserTO, GithubIssueTimelineItemTO, GithubPullRequestTimelineItemTO, GithubGitObjectTO, GithubNodeTO, GithubSubscribableTO, GithubUniformResourceLocatableTO{
...
...
src/test/resources/expected-classes/InputWithDefaults.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.testdefaults;
import java.util.*;
/**
* This input has all possible types
...
...
@@ -16,14 +15,14 @@ public class InputWithDefaults {
private MyEnum nonNullEnumVal = MyEnum.TWO;
private SomeObject objectWithNullDefault = null;
private SomeObject objectWithNonNullDefault;
private
Collection<Integer> intList =
Arrays.asList(1, 2, 3);
private
Collection<Integer> intListEmptyDefault =
Collections.emptyList();
private
Collection<SomeObject> objectListEmptyDefault =
Collections.emptyList();
private
java.util.Collection<Integer> intList = java.util.
Arrays.asList(1, 2, 3);
private
java.util.Collection<Integer> intListEmptyDefault = java.util.
Collections.emptyList();
private
java.util.Collection<SomeObject> objectListEmptyDefault = java.util.
Collections.emptyList();
public InputWithDefaults() {
}
public InputWithDefaults(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal, MyEnum enumVal, MyEnum nonNullEnumVal, SomeObject objectWithNullDefault, SomeObject objectWithNonNullDefault,
Collection<Integer> intList, Collection<Integer> intListEmptyDefault,
Collection<SomeObject> objectListEmptyDefault) {
public InputWithDefaults(Double floatVal, Boolean booleanVal, Integer intVal, String stringVal, MyEnum enumVal, MyEnum nonNullEnumVal, SomeObject objectWithNullDefault, SomeObject objectWithNonNullDefault,
java.util.Collection<Integer> intList, java.util.Collection<Integer> intListEmptyDefault, java.util.
Collection<SomeObject> objectListEmptyDefault) {
this.floatVal = floatVal;
this.booleanVal = booleanVal;
this.intVal = intVal;
...
...
@@ -93,24 +92,24 @@ public class InputWithDefaults {
this.objectWithNonNullDefault = objectWithNonNullDefault;
}
public Collection<Integer> getIntList() {
public
java.util.
Collection<Integer> getIntList() {
return intList;
}
public void setIntList(Collection<Integer> intList) {
public void setIntList(
java.util.
Collection<Integer> intList) {
this.intList = intList;
}
public Collection<Integer> getIntListEmptyDefault() {
public
java.util.
Collection<Integer> getIntListEmptyDefault() {
return intListEmptyDefault;
}
public void setIntListEmptyDefault(Collection<Integer> intListEmptyDefault) {
public void setIntListEmptyDefault(
java.util.
Collection<Integer> intListEmptyDefault) {
this.intListEmptyDefault = intListEmptyDefault;
}
public Collection<SomeObject> getObjectListEmptyDefault() {
public
java.util.
Collection<SomeObject> getObjectListEmptyDefault() {
return objectListEmptyDefault;
}
public void setObjectListEmptyDefault(Collection<SomeObject> objectListEmptyDefault) {
public void setObjectListEmptyDefault(
java.util.
Collection<SomeObject> objectListEmptyDefault) {
this.objectListEmptyDefault = objectListEmptyDefault;
}
...
...
@@ -126,9 +125,9 @@ public class InputWithDefaults {
private MyEnum nonNullEnumVal = MyEnum.TWO;
private SomeObject objectWithNullDefault = null;
private SomeObject objectWithNonNullDefault;
private
Collection<Integer> intList =
Arrays.asList(1, 2, 3);
private
Collection<Integer> intListEmptyDefault =
Collections.emptyList();
private
Collection<SomeObject> objectListEmptyDefault =
Collections.emptyList();
private
java.util.Collection<Integer> intList = java.util.
Arrays.asList(1, 2, 3);
private
java.util.Collection<Integer> intListEmptyDefault = java.util.
Collections.emptyList();
private
java.util.Collection<SomeObject> objectListEmptyDefault = java.util.
Collections.emptyList();
public Builder() {
}
...
...
@@ -173,17 +172,17 @@ public class InputWithDefaults {
return this;
}
public Builder setIntList(Collection<Integer> intList) {
public Builder setIntList(
java.util.
Collection<Integer> intList) {
this.intList = intList;
return this;
}
public Builder setIntListEmptyDefault(Collection<Integer> intListEmptyDefault) {
public Builder setIntListEmptyDefault(
java.util.
Collection<Integer> intListEmptyDefault) {
this.intListEmptyDefault = intListEmptyDefault;
return this;
}
public Builder setObjectListEmptyDefault(Collection<SomeObject> objectListEmptyDefault) {
public Builder setObjectListEmptyDefault(
java.util.
Collection<SomeObject> objectListEmptyDefault) {
this.objectListEmptyDefault = objectListEmptyDefault;
return this;
}
...
...
src/test/resources/expected-classes/Mutation.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface Mutation {
...
...
src/test/resources/expected-classes/MyUnion.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.multifiles;
import java.util.*;
public interface MyUnion {
...
...
src/test/resources/expected-classes/ProfileOwner.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
public interface ProfileOwner {
...
...
src/test/resources/expected-classes/Query.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface Query {
...
...
@@ -14,7 +13,7 @@ public interface Query {
* List of events of a specified category.
*/
@javax.validation.constraints.NotNull
Collection<Event> eventsByCategoryAndStatus(String categoryId, EventStatus status) throws Exception;
java.util.
Collection<Event> eventsByCategoryAndStatus(String categoryId, EventStatus status) throws Exception;
/**
* Single event by ID.
...
...
@@ -26,6 +25,6 @@ public interface Query {
* Events by IDs.
*/
@javax.validation.constraints.NotNull
Collection<Event> eventsByIds(
Collection<String> ids) throws Exception;
java.util.Collection<Event> eventsByIds(java.util.
Collection<String> ids) throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/SomeObject.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.testdefaults;
import java.util.*;
public class SomeObject {
...
...
src/test/resources/expected-classes/Subscription.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface Subscription {
...
...
@@ -8,6 +7,6 @@ public interface Subscription {
* Subscribe to events
*/
@javax.validation.constraints.NotNull
Collection<Event> eventsCreated() throws Exception;
java.util.
Collection<Event> eventsCreated() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/UnionMember1.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.multifiles;
import java.util.*;
public class UnionMember1 implements MyUnion{
...
...
src/test/resources/expected-classes/UnionMember2.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.multifiles;
import java.util.*;
public class UnionMember2 implements MyUnion{
...
...
src/test/resources/expected-classes/VersionQuery.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface VersionQuery {
...
...
src/test/resources/expected-classes/deprecated/CreateEventMutation.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface CreateEventMutation {
...
...
src/test/resources/expected-classes/deprecated/Event.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public class Event implements PinnableItem, Node{
...
...
src/test/resources/expected-classes/deprecated/EventInput.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public class EventInput {
...
...
src/test/resources/expected-classes/deprecated/EventsQuery.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface EventsQuery {
@Deprecated
@javax.validation.constraints.NotNull
Collection<Event> events() throws Exception;
java.util.
Collection<Event> events() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/deprecated/Mutation.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface Mutation {
...
...
src/test/resources/expected-classes/deprecated/Node.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface Node {
...
...
src/test/resources/expected-classes/deprecated/PinnableItem.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface PinnableItem {
...
...
src/test/resources/expected-classes/deprecated/Query.java.txt
浏览文件 @
02a61d4a
package com.kobylynskyi.graphql.test1;
import java.util.*;
public interface Query {
@Deprecated
@javax.validation.constraints.NotNull
Collection<Event> events() throws Exception;
java.util.
Collection<Event> events() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend-with-resolvers/Asset.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class Asset implements PinnableItem, Node{
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/AssetInput.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class AssetInput {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/AssetsQuery.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface AssetsQuery {
@javax.validation.constraints.NotNull
Collection<Asset> assets() throws Exception;
java.util.
Collection<Asset> assets() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend-with-resolvers/CreateAssetMutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface CreateAssetMutation {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/CreateEventMutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface CreateEventMutation {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/Event.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class Event implements PinnableItem, Node{
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/EventInput.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class EventInput {
@javax.validation.constraints.NotNull
private Status status;
@javax.validation.constraints.NotNull
private Collection<AssetInput> assets;
private
java.util.
Collection<AssetInput> assets;
public EventInput() {
}
public EventInput(Status status, Collection<AssetInput> assets) {
public EventInput(Status status,
java.util.
Collection<AssetInput> assets) {
this.status = status;
this.assets = assets;
}
...
...
@@ -22,10 +20,10 @@ public class EventInput {
this.status = status;
}
public Collection<AssetInput> getAssets() {
public
java.util.
Collection<AssetInput> getAssets() {
return assets;
}
public void setAssets(Collection<AssetInput> assets) {
public void setAssets(
java.util.
Collection<AssetInput> assets) {
this.assets = assets;
}
...
...
@@ -34,7 +32,7 @@ public class EventInput {
public static class Builder {
private Status status;
private Collection<AssetInput> assets;
private
java.util.
Collection<AssetInput> assets;
public Builder() {
}
...
...
@@ -44,7 +42,7 @@ public class EventInput {
return this;
}
public Builder setAssets(Collection<AssetInput> assets) {
public Builder setAssets(
java.util.
Collection<AssetInput> assets) {
this.assets = assets;
return this;
}
...
...
src/test/resources/expected-classes/extend-with-resolvers/EventResolver.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface EventResolver {
/**
* Optional list of assets
*/
@javax.validation.constraints.NotNull
Collection<Asset> assets(Event event) throws Exception;
java.util.
Collection<Asset> assets(Event event) throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend-with-resolvers/EventsQuery.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface EventsQuery {
@javax.validation.constraints.NotNull
Collection<Event> events() throws Exception;
java.util.
Collection<Event> events() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend-with-resolvers/Mutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Mutation {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/Node.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Node {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend-with-resolvers/NodeResolver.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface NodeResolver {
String createdBy(Node node) throws Exception;
...
...
src/test/resources/expected-classes/extend-with-resolvers/PinnableItem.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface PinnableItem {
}
\ No newline at end of file
src/test/resources/expected-classes/extend-with-resolvers/Query.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Query {
@javax.validation.constraints.NotNull
Collection<Event> events() throws Exception;
java.util.
Collection<Event> events() throws Exception;
@javax.validation.constraints.NotNull
Collection<Asset> assets() throws Exception;
java.util.
Collection<Asset> assets() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend/Asset.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class Asset implements PinnableItem, Node{
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend/AssetInput.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class AssetInput {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend/AssetsQuery.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface AssetsQuery {
@javax.validation.constraints.NotNull
Collection<Asset> assets() throws Exception;
java.util.
Collection<Asset> assets() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend/CreateAssetMutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface CreateAssetMutation {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend/CreateEventMutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface CreateEventMutation {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend/Event.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class Event implements PinnableItem, Node{
@javax.validation.constraints.NotNull
...
...
@@ -7,7 +5,7 @@ public class Event implements PinnableItem, Node{
@javax.validation.constraints.NotNull
private String createdDateTime;
@javax.validation.constraints.NotNull
private Collection<Asset> assets;
private
java.util.
Collection<Asset> assets;
@javax.validation.constraints.NotNull
private String id;
private String createdBy;
...
...
@@ -15,7 +13,7 @@ public class Event implements PinnableItem, Node{
public Event() {
}
public Event(Status status, String createdDateTime, Collection<Asset> assets, String id, String createdBy) {
public Event(Status status, String createdDateTime,
java.util.
Collection<Asset> assets, String id, String createdBy) {
this.status = status;
this.createdDateTime = createdDateTime;
this.assets = assets;
...
...
@@ -40,13 +38,13 @@ public class Event implements PinnableItem, Node{
/**
* Optional list of assets
*/
public Collection<Asset> getAssets() {
public
java.util.
Collection<Asset> getAssets() {
return assets;
}
/**
* Optional list of assets
*/
public void setAssets(Collection<Asset> assets) {
public void setAssets(
java.util.
Collection<Asset> assets) {
this.assets = assets;
}
...
...
@@ -70,7 +68,7 @@ public class Event implements PinnableItem, Node{
private Status status;
private String createdDateTime;
private Collection<Asset> assets;
private
java.util.
Collection<Asset> assets;
private String id;
private String createdBy;
...
...
@@ -90,7 +88,7 @@ public class Event implements PinnableItem, Node{
/**
* Optional list of assets
*/
public Builder setAssets(Collection<Asset> assets) {
public Builder setAssets(
java.util.
Collection<Asset> assets) {
this.assets = assets;
return this;
}
...
...
src/test/resources/expected-classes/extend/EventInput.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public class EventInput {
@javax.validation.constraints.NotNull
private Status status;
@javax.validation.constraints.NotNull
private Collection<AssetInput> assets;
private
java.util.
Collection<AssetInput> assets;
public EventInput() {
}
public EventInput(Status status, Collection<AssetInput> assets) {
public EventInput(Status status,
java.util.
Collection<AssetInput> assets) {
this.status = status;
this.assets = assets;
}
...
...
@@ -22,10 +20,10 @@ public class EventInput {
this.status = status;
}
public Collection<AssetInput> getAssets() {
public
java.util.
Collection<AssetInput> getAssets() {
return assets;
}
public void setAssets(Collection<AssetInput> assets) {
public void setAssets(
java.util.
Collection<AssetInput> assets) {
this.assets = assets;
}
...
...
@@ -34,7 +32,7 @@ public class EventInput {
public static class Builder {
private Status status;
private Collection<AssetInput> assets;
private
java.util.
Collection<AssetInput> assets;
public Builder() {
}
...
...
@@ -44,7 +42,7 @@ public class EventInput {
return this;
}
public Builder setAssets(Collection<AssetInput> assets) {
public Builder setAssets(
java.util.
Collection<AssetInput> assets) {
this.assets = assets;
return this;
}
...
...
src/test/resources/expected-classes/extend/EventsQuery.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface EventsQuery {
@javax.validation.constraints.NotNull
Collection<Event> events() throws Exception;
java.util.
Collection<Event> events() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend/Mutation.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Mutation {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend/Node.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Node {
@javax.validation.constraints.NotNull
...
...
src/test/resources/expected-classes/extend/PinnableItem.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface PinnableItem {
}
\ No newline at end of file
src/test/resources/expected-classes/extend/Query.java.txt
浏览文件 @
02a61d4a
import java.util.*;
public interface Query {
@javax.validation.constraints.NotNull
Collection<Event> events() throws Exception;
java.util.
Collection<Event> events() throws Exception;
@javax.validation.constraints.NotNull
Collection<Asset> assets() throws Exception;
java.util.
Collection<Asset> assets() throws Exception;
}
\ No newline at end of file
src/test/resources/expected-classes/extend/request/AssetResponseProjection.java.txt
浏览文件 @
02a61d4a
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
/**
* Response projection for Asset
...
...
src/test/resources/expected-classes/extend/request/EventResponseProjection.java.txt
浏览文件 @
02a61d4a
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
/**
* Response projection for Event
...
...
src/test/resources/expected-classes/request/AcceptTopicSuggestionInput.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLRequestSerializer;
import java.util.StringJoiner;
public class AcceptTopicSuggestionInput {
...
...
@@ -45,13 +46,13 @@ public class AcceptTopicSuggestionInput {
public String toString() {
StringJoiner joiner = new StringJoiner(", ", "{ ", " }");
if (clientMutationId != null) {
joiner.add("clientMutationId: \"" +
com.kobylynskyi.graphql.codegen.model.graphql.
GraphQLRequestSerializer.escapeJsonString(clientMutationId) + "\"");
joiner.add("clientMutationId: \"" + GraphQLRequestSerializer.escapeJsonString(clientMutationId) + "\"");
}
if (name != null) {
joiner.add("name: \"" +
com.kobylynskyi.graphql.codegen.model.graphql.
GraphQLRequestSerializer.escapeJsonString(name) + "\"");
joiner.add("name: \"" + GraphQLRequestSerializer.escapeJsonString(name) + "\"");
}
if (repositoryId != null) {
joiner.add("repositoryId: \"" +
com.kobylynskyi.graphql.codegen.model.graphql.
GraphQLRequestSerializer.escapeJsonString(repositoryId) + "\"");
joiner.add("repositoryId: \"" + GraphQLRequestSerializer.escapeJsonString(repositoryId) + "\"");
}
return joiner.toString();
}
...
...
src/test/resources/expected-classes/request/CodeOfConductResponseProjection.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
/**
* Response projection for CodeOfConduct
...
...
src/test/resources/expected-classes/request/EventPropertyResponseProjection.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
/**
* Response projection for EventProperty
...
...
src/test/resources/expected-classes/request/EventResponseProjection.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
/**
* Response projection for Event
...
...
src/test/resources/expected-classes/request/EventsByCategoryAndStatusQueryRequest.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperation;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperationRequest;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* List of events of a specified category.
...
...
src/test/resources/expected-classes/request/EventsByCategoryAndStatusQueryRequest_withApiImport.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.github.graphql.api.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperation;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperationRequest;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* List of events of a specified category.
...
...
src/test/resources/expected-classes/request/EventsByCategoryAndStatusQueryRequest_withModelSuffix.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperation;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperationRequest;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* List of events of a specified category.
...
...
src/test/resources/expected-classes/request/EventsByIdsQueryRequest.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperation;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperationRequest;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* Events by IDs.
...
...
@@ -16,7 +19,7 @@ public class EventsByIdsQueryRequest implements GraphQLOperationRequest {
public EventsByIdsQueryRequest() {
}
public void setIds(Collection<String> ids) {
public void setIds(
java.util.
Collection<String> ids) {
this.input.put("ids", ids);
}
...
...
@@ -42,12 +45,12 @@ public class EventsByIdsQueryRequest implements GraphQLOperationRequest {
public static class Builder {
private Collection<String> ids;
private
java.util.
Collection<String> ids;
public Builder() {
}
public Builder setIds(Collection<String> ids) {
public Builder setIds(
java.util.
Collection<String> ids) {
this.ids = ids;
return this;
}
...
...
src/test/resources/expected-classes/request/UpdateRepositoryMutationRequest.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperation;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperationRequest;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
public class UpdateRepositoryMutationRequest implements GraphQLOperationRequest {
...
...
src/test/resources/expected-classes/request/VersionQueryRequest.java.txt
浏览文件 @
02a61d4a
package com.github.graphql;
import java.util.*;
import com.kobylynskyi.graphql.codegen.model.graphql.*;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperation;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLOperationRequest;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* Version of the application.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录