Skip to content

Commit

Permalink
♻️ Remove deprecation warnings from org.restheart.graphql.scalars cla…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
ujibang committed Jan 9, 2024
1 parent 18f9f43 commit 63e2bf7
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public Boolean serialize(Object input, GraphQLContext graphQLContext, Locale loc

@Override
public Boolean parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException {
return (Boolean) CoercingUtils.builtInCoercing.get("Boolean").parseValue(input);
return (Boolean) CoercingUtils.builtInCoercing.get("Boolean").parseValue(input, graphQLContext, locale);
}

@Override
public Boolean parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException {
return (Boolean) CoercingUtils.builtInCoercing.get("Boolean").parseLiteral(input);
return (Boolean) CoercingUtils.builtInCoercing.get("Boolean").parseLiteral(input, variables, graphQLContext, locale);
}

@Override
public Value<?> valueToLiteral(Object input) {
return CoercingUtils.builtInCoercing.get("Boolean").valueToLiteral(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
return CoercingUtils.builtInCoercing.get("Boolean").valueToLiteral(input, graphQLContext, locale);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ private Long convertImpl(Object input){
}

@Override
public Value<?> valueToLiteral(Object input) {
var value = serialize(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
var value = serialize(input, graphQLContext, locale);
var s = BsonUtils.toJson(value);
return StringValue.newStringValue(s).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private boolean isANumber(Object input) {
}

@Override
public Value<?> valueToLiteral(Object input) {
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
var value = parseValue(input);
var s = BsonUtils.toJson(value);
return StringValue.newStringValue(s).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public BsonValue parseObjectField(Object input, Map<String, Object> variables) t
}

@Override
public Value<?> valueToLiteral(Object input) {
var value = parseValue(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
var value = parseValue(input, graphQLContext, locale);
var s = BsonUtils.toJson(value);
return StringValue.newStringValue(s).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public Double serialize(Object input, GraphQLContext graphQLContext, Locale loca

@Override
public Double parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException {
return (Double) CoercingUtils.builtInCoercing.get("Float").parseValue(input);
return (Double) CoercingUtils.builtInCoercing.get("Float").parseValue(input, graphQLContext, locale);
}

@Override
public Double parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException {
return (Double) CoercingUtils.builtInCoercing.get("Float").parseLiteral(input);
return (Double) CoercingUtils.builtInCoercing.get("Float").parseLiteral(input, variables, graphQLContext, locale);
}

@Override
public Value<?> valueToLiteral(Object input) {
return CoercingUtils.builtInCoercing.get("Float").valueToLiteral(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
return CoercingUtils.builtInCoercing.get("Float").valueToLiteral(input, graphQLContext, locale);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public Integer serialize(Object input, GraphQLContext graphQLContext, Locale loc

@Override
public Integer parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException {
return (Integer) CoercingUtils.builtInCoercing.get("Int").parseValue(input);
return (Integer) CoercingUtils.builtInCoercing.get("Int").parseValue(input, graphQLContext, locale);
}

@Override
public Integer parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException {
return (Integer) CoercingUtils.builtInCoercing.get("Int").parseLiteral(input);
return (Integer) CoercingUtils.builtInCoercing.get("Int").parseLiteral(input, variables, graphQLContext, locale);
}

@Override
public Value<?> valueToLiteral(Object input) {
return CoercingUtils.builtInCoercing.get("Int").valueToLiteral(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
return CoercingUtils.builtInCoercing.get("Int").valueToLiteral(input, graphQLContext, locale);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public Long serialize(Object input, GraphQLContext graphQLContext, Locale locale

@Override
public Long parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException {
return (Long) CoercingUtils.builtInCoercing.get("Long").parseValue(input);
return (Long) CoercingUtils.builtInCoercing.get("Long").parseValue(input, graphQLContext, locale);
}

@Override
public Long parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException {
return (Long) CoercingUtils.builtInCoercing.get("Long").parseLiteral(input);
return (Long) CoercingUtils.builtInCoercing.get("Long").parseLiteral(input, variables, graphQLContext, locale);
}

@Override
public Value<?> valueToLiteral(Object input) {
return CoercingUtils.builtInCoercing.get("Long").valueToLiteral(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
return CoercingUtils.builtInCoercing.get("Long").valueToLiteral(input, graphQLContext, locale);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ else if(obj instanceof BsonValue){
}

@Override
public Value<?> valueToLiteral(Object input) {
var value = serialize(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
var value = serialize(input, graphQLContext, locale);
var s = BsonUtils.toJson(new BsonObjectId(value));
return StringValue.newStringValue(s).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public BsonRegularExpression parseLiteral(Value<?> input, CoercedVariables varia
}

@Override
public Value<?> valueToLiteral(Object input) {
var value = serialize(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
var value = serialize(input, graphQLContext, locale);
var s = BsonUtils.toJson(value);
return StringValue.newStringValue(s).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ public String serialize(Object input, GraphQLContext graphQLContext, Locale loca

@Override
public String parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException {
return (String) CoercingUtils.builtInCoercing.get("String").parseValue(input);
return (String) CoercingUtils.builtInCoercing.get("String").parseValue(input, graphQLContext, locale);
}

@Override
public String parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException {
return (String) CoercingUtils.builtInCoercing.get("String").parseLiteral(input);
return (String) CoercingUtils.builtInCoercing.get("String").parseLiteral(input, variables, graphQLContext, locale);
}

@Override
public Value<?> valueToLiteral(Object input) {
return CoercingUtils.builtInCoercing.get("String").valueToLiteral(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
return CoercingUtils.builtInCoercing.get("String").valueToLiteral(input, graphQLContext, locale);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ public BsonTimestamp serialize(Object input, GraphQLContext graphQLContext, Loca

@Override
public BsonTimestamp parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException {
var timestamp = (Long) CoercingUtils.builtInCoercing.get("Long").parseValue(input);
var timestamp = (Long) CoercingUtils.builtInCoercing.get("Long").parseValue(input, graphQLContext, locale);
return new BsonTimestamp(timestamp);
}

@Override
public BsonTimestamp parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException {
var timestamp = (Long) CoercingUtils.builtInCoercing.get("Long").parseLiteral(input);
var timestamp = (Long) CoercingUtils.builtInCoercing.get("Long").parseLiteral(input, variables, graphQLContext, locale);
return new BsonTimestamp(timestamp);
}

@Override
public Value<?> valueToLiteral(Object input) {
var value = serialize(input);
public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) {
var value = serialize(input, graphQLContext, locale);
var s = BsonUtils.toJson(value);
return StringValue.newStringValue(s).build();
}
Expand Down

0 comments on commit 63e2bf7

Please sign in to comment.