Skip to content

Commit 4268506

Browse files
committed
fixing tests
1 parent 204fc3a commit 4268506

9 files changed

Lines changed: 109 additions & 0 deletions

File tree

‎src/main/java/graphql/language/Argument.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ private Argument(String name, Value value, SourceLocation sourceLocation, List<C
2121
this.value = value;
2222
}
2323

24+
/**
25+
* alternative to using a Builder for convenience
26+
*
27+
* @param name
28+
* @param value
29+
*/
30+
public Argument(String name, Value value) {
31+
super(null, new ArrayList<>());
32+
this.name = name;
33+
this.value = value;
34+
}
35+
2436
@Override
2537
public String getName() {
2638
return name;

‎src/main/java/graphql/language/ArrayValue.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ private ArrayValue(List<Value> values, SourceLocation sourceLocation, List<Comme
1919
this.values.addAll(values);
2020
}
2121

22+
/**
23+
* alternative to using a Builder for convenience
24+
*
25+
* @param values
26+
*/
27+
public ArrayValue(List<Value> values) {
28+
super(null, new ArrayList<>());
29+
this.values.addAll(values);
30+
}
31+
2232
public List<Value> getValues() {
2333
return new ArrayList<>(values);
2434
}

‎src/main/java/graphql/language/BooleanValue.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ private BooleanValue(boolean value, SourceLocation sourceLocation, List<Comment>
1919
this.value = value;
2020
}
2121

22+
/**
23+
* alternative to using a Builder for convenience
24+
*
25+
* @param value
26+
*/
27+
public BooleanValue(boolean value) {
28+
super(null, new ArrayList<>());
29+
this.value = value;
30+
}
31+
2232
public boolean isValue() {
2333
return value;
2434
}

‎src/main/java/graphql/language/EnumValue.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ private EnumValue(String name, SourceLocation sourceLocation, List<Comment> comm
1919
this.name = name;
2020
}
2121

22+
23+
/**
24+
* alternative to using a Builder for convenience
25+
*
26+
* @param name
27+
*/
28+
public EnumValue(String name) {
29+
super(null, new ArrayList<>());
30+
this.name = name;
31+
}
32+
2233
@Override
2334
public String getName() {
2435
return name;

‎src/main/java/graphql/language/IntValue.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ private IntValue(BigInteger value, SourceLocation sourceLocation, List<Comment>
2020
this.value = value;
2121
}
2222

23+
/**
24+
* alternative to using a Builder for convenience
25+
*
26+
* @param value
27+
*/
28+
public IntValue(BigInteger value) {
29+
super(null, new ArrayList<>());
30+
this.value = value;
31+
}
32+
2333
public BigInteger getValue() {
2434
return value;
2535
}

‎src/main/java/graphql/language/NonNullType.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ private NonNullType(Type type, SourceLocation sourceLocation, List<Comment> comm
2020
this.type = type;
2121
}
2222

23+
/**
24+
* alternative to using a Builder for convenience
25+
*
26+
* @param type
27+
*/
28+
public NonNullType(Type type) {
29+
super(null, new ArrayList<>());
30+
31+
this.type = type;
32+
}
33+
2334
public Type getType() {
2435
return type;
2536
}

‎src/main/java/graphql/language/StringValue.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ private StringValue(String value, SourceLocation sourceLocation, List<Comment> c
1919
this.value = value;
2020
}
2121

22+
/**
23+
* alternative to using a Builder for convenience
24+
*
25+
* @param value
26+
*/
27+
public StringValue(String value) {
28+
super(null, new ArrayList<>());
29+
this.value = value;
30+
}
31+
2232
public String getValue() {
2333
return value;
2434
}

‎src/main/java/graphql/language/TypeName.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ private TypeName(String name, SourceLocation sourceLocation, List<Comment> comme
1919
this.name = name;
2020
}
2121

22+
/**
23+
* alternative to using a Builder for convenience
24+
*
25+
* @param name
26+
*/
27+
public TypeName(String name) {
28+
super(null, new ArrayList<>());
29+
this.name = name;
30+
}
31+
32+
2233
public String getName() {
2334
return name;
2435
}

‎src/main/java/graphql/language/VariableDefinition.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,30 @@ private VariableDefinition(String name,
2727
this.defaultValue = defaultValue;
2828
}
2929

30+
/**
31+
* alternative to using a Builder for convenience
32+
*/
33+
public VariableDefinition(String name,
34+
Type type,
35+
Value defaultValue) {
36+
super(null, new ArrayList<>());
37+
this.name = name;
38+
this.type = type;
39+
this.defaultValue = defaultValue;
40+
}
41+
42+
/**
43+
* alternative to using a Builder for convenience
44+
*/
45+
public VariableDefinition(String name,
46+
Type type) {
47+
super(null, new ArrayList<>());
48+
this.name = name;
49+
this.type = type;
50+
this.defaultValue = null;
51+
}
52+
53+
3054
public Value getDefaultValue() {
3155
return defaultValue;
3256
}

0 commit comments

Comments
 (0)