Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] ParamConverterProvider constructors are now protected to allow extensibility #5792

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 Payara Foundation and/or its affiliates.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -121,7 +121,7 @@ public String toString(final T value) throws IllegalArgumentException {
@Singleton
public static class StringConstructor extends ParamConverterCompliance implements ParamConverterProvider {

private StringConstructor(boolean canReturnNull) {
protected StringConstructor(boolean canReturnNull) {
super(canReturnNull);
}

Expand Down Expand Up @@ -150,7 +150,7 @@ protected T _fromString(final String value) throws Exception {
@Singleton
public static class TypeValueOf extends ParamConverterCompliance implements ParamConverterProvider {

private TypeValueOf(boolean canReturnNull) {
protected TypeValueOf(boolean canReturnNull) {
super(canReturnNull);
}

Expand Down Expand Up @@ -178,7 +178,7 @@ public T _fromString(final String value) throws Exception {
@Singleton
public static class TypeFromString extends ParamConverterCompliance implements ParamConverterProvider {

private TypeFromString(boolean canReturnNull) {
protected TypeFromString(boolean canReturnNull) {
super(canReturnNull);
}

Expand Down Expand Up @@ -206,7 +206,7 @@ public T _fromString(final String value) throws Exception {
@Singleton
public static class TypeFromStringEnum extends TypeFromString {

private TypeFromStringEnum(boolean canReturnNull) {
protected TypeFromStringEnum(boolean canReturnNull) {
super(canReturnNull);
}

Expand All @@ -221,7 +221,7 @@ public <T> ParamConverter<T> getConverter(final Class<T> rawType,
@Singleton
public static class CharacterProvider extends ParamConverterCompliance implements ParamConverterProvider {

private CharacterProvider(boolean canReturnNull) {
protected CharacterProvider(boolean canReturnNull) {
super(canReturnNull);
}

Expand Down Expand Up @@ -266,7 +266,7 @@ public String toString(T value) {
@Singleton
public static class DateProvider extends ParamConverterCompliance implements ParamConverterProvider {

private DateProvider(boolean canReturnNull) {
protected DateProvider(boolean canReturnNull) {
super(canReturnNull);
}

Expand Down Expand Up @@ -309,7 +309,7 @@ public static class OptionalCustomProvider extends ParamConverterCompliance impl
// Delegates to this provider when the type of Optional is extracted.
private final InjectionManager manager;

public OptionalCustomProvider(InjectionManager manager, boolean canReturnNull) {
protected OptionalCustomProvider(InjectionManager manager, boolean canReturnNull) {
super(canReturnNull);
this.manager = manager;
}
Expand Down Expand Up @@ -365,6 +365,8 @@ public String toString(T value) throws IllegalArgumentException {
@Singleton
public static class OptionalProvider implements ParamConverterProvider {

protected OptionalProvider() {}

@Override
public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) {
final Optionals optionals = Optionals.getOptional(rawType);
Expand Down