Skip to content

fix: Fix typo in Affordances #2346

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Expand Up @@ -39,6 +39,7 @@
* Primary API to construct {@link Affordance} instances.
*
* @author Oliver Drotbohm
* @author Jongha Park
* @see #afford(HttpMethod)
*/
public class Affordances implements AffordanceOperations {
Expand Down Expand Up @@ -100,19 +101,19 @@ private static class AffordanceBuilder implements ConfigurableAffordance, Config
private final Affordances context;
private final HttpMethod method;
private final Link target;
private final InputPayloadMetadata inputMetdata;
private final InputPayloadMetadata inputMetadata;
private final PayloadMetadata outputMetadata;

private List<QueryParameter> parameters = Collections.emptyList();
private @Nullable String name;

private AffordanceBuilder(Affordances context, HttpMethod method, Link target, InputPayloadMetadata inputMetdata,
private AffordanceBuilder(Affordances context, HttpMethod method, Link target, InputPayloadMetadata inputMetadata,
PayloadMetadata outputMetadata, List<QueryParameter> parameters, @Nullable String name) {

this.context = context;
this.method = method;
this.target = target;
this.inputMetdata = inputMetdata;
this.inputMetadata = inputMetadata;
this.outputMetadata = outputMetadata;
this.parameters = parameters;
this.name = name;
Expand Down Expand Up @@ -205,7 +206,7 @@ public ConfigurableAffordance withOutput(ResolvableType type) {
*/
@Override
public ConfigurableAffordance withOutput(PayloadMetadata metadata) {
return new AffordanceBuilder(context, method, target, inputMetdata, metadata, parameters, name);
return new AffordanceBuilder(context, method, target, inputMetadata, metadata, parameters, name);
}

/*
Expand All @@ -223,7 +224,7 @@ public ConfigurableAffordance withInputMediaType(MediaType inputMediaType) {
*/
@Override
public ConfigurableAffordance withInputMediaTypes(List<MediaType> inputMediaTypes) {
return withInput(inputMetdata.withMediaTypes(inputMediaTypes));
return withInput(inputMetadata.withMediaTypes(inputMediaTypes));
}

/*
Expand All @@ -241,7 +242,7 @@ public ConfigurableAffordance withParameters(QueryParameter... parameters) {
*/
@Override
public ConfigurableAffordance withParameters(List<QueryParameter> parameters) {
return new AffordanceBuilder(context, method, target, inputMetdata, outputMetadata, parameters, name);
return new AffordanceBuilder(context, method, target, inputMetadata, outputMetadata, parameters, name);
}

/*
Expand All @@ -255,7 +256,7 @@ public ConfigurableAffordance addParameters(QueryParameter... parameters) {
newParameters.addAll(this.parameters);
newParameters.addAll(Arrays.asList(parameters));

return new AffordanceBuilder(context, method, target, inputMetdata, outputMetadata, newParameters, name);
return new AffordanceBuilder(context, method, target, inputMetadata, outputMetadata, newParameters, name);
}

/*
Expand All @@ -268,7 +269,7 @@ public ConfigurableAffordance withTarget(Link target) {
Assert.notNull(target, "Target must not be null!");

return this.target == target ? this
: new AffordanceBuilder(this.context, this.method, target, this.inputMetdata, this.outputMetadata,
: new AffordanceBuilder(this.context, this.method, target, this.inputMetadata, this.outputMetadata,
this.parameters, this.name);
}

Expand All @@ -280,7 +281,7 @@ public ConfigurableAffordance withTarget(Link target) {
public ConfigurableAffordance withName(@Nullable String name) {

return this.name == name ? this
: new AffordanceBuilder(this.context, this.method, this.target, this.inputMetdata, this.outputMetadata,
: new AffordanceBuilder(this.context, this.method, this.target, this.inputMetadata, this.outputMetadata,
this.parameters, name);
}

Expand Down Expand Up @@ -323,8 +324,8 @@ public String getNameOrDefault() {

String name = method.toString().toLowerCase();

Class<?> type = TypeBasedPayloadMetadata.class.isInstance(inputMetdata) //
? TypeBasedPayloadMetadata.class.cast(inputMetdata).getType() //
Class<?> type = TypeBasedPayloadMetadata.class.isInstance(inputMetadata) //
? TypeBasedPayloadMetadata.class.cast(inputMetadata).getType() //
: null;

return type == null ? name : name.concat(type.getSimpleName());
Expand All @@ -345,7 +346,7 @@ public HttpMethod getMethod() {
*/
@Override
public InputPayloadMetadata getInputMetadata() {
return inputMetdata;
return inputMetadata;
}

/*
Expand Down