Conversation
LMCROSSITXSADEPLOY-3563
… from poms LMCROSSITXSADEPLOY-3054
LMCROSSITXSADEPLOY-3563
LMCROSSITXSADEPLOY-3563
LMCROSSITXSADEPLOY-3563
2b06745 to
698462b
Compare
LMCROSSITXSADEPLOY-3563
LMCROSSITXSADEPLOY-3563
LMCROSSITXSADEPLOY-3563
|
| public String getValue() { | ||
| return name().toLowerCase(); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return this.name().toLowerCase(); | ||
| return this.name() | ||
| .toLowerCase(); | ||
| } |
There was a problem hiding this comment.
Why don't you use just of the two methods because they are the same?
There was a problem hiding this comment.
you are right, fixed
| this.labels = labels == null ? Collections.emptyMap() : Collections.unmodifiableMap(new LinkedHashMap<>(labels)); | ||
| this.annotations = annotations == null ? Collections.emptyMap() : Collections.unmodifiableMap(new LinkedHashMap<>(annotations)); |
There was a problem hiding this comment.
Can you use Map.copyOf instead of Collections.unmodifiableMap(new LinkedHashMap<>(...)?
There was a problem hiding this comment.
Have thought about this, but wanted to be a bit more sure, since copyOf() does not allow the key value pairs to have nulls, while the unmodifiableMap() allows it.
| public Builder labels(Map<String, String> labels) { | ||
| if (labels != null) { | ||
| this.labels.putAll(labels); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
|
|
||
| public Builder putAllLabels(Map<String, String> labels) { | ||
| return labels(labels); | ||
| } |
There was a problem hiding this comment.
Can you leave only one method because are the same but with differnet name
| public Builder annotations(Map<String, String> annotations) { | ||
| if (annotations != null) { | ||
| this.annotations.putAll(annotations); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
|
|
||
| public Builder putAllAnnotations(Map<String, String> annotations) { | ||
| return annotations(annotations); | ||
| } |
| public record V3Application(@JsonProperty("guid") String guid, @JsonProperty("name") String name, @JsonProperty("state") String state, | ||
| @JsonProperty("created_at") String createdAt, @JsonProperty("updated_at") String updatedAt, | ||
| @JsonProperty("lifecycle") V3Lifecycle lifecycle, @JsonProperty("metadata") V3Metadata metadata, | ||
| @JsonProperty("relationships") V3Relationships relationships) { |
There was a problem hiding this comment.
Can we extract these string in a constant calss because they are repeated more in other classes
| } | ||
| } | ||
|
|
||
| @SuppressWarnings("unchecked") |
| return (Map<String, Object>) JsonUtil.convertJsonToMap(response.body()) | ||
| .get(Constants.ROOT_DOCUMENT_LINKS_LIST); |
| requestTags.forEach(requestBuilder::header); | ||
| HttpResponse<String> response = getSimpleHttpClient().send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString()); | ||
|
|
||
| if (response.statusCode() / 100 != 2) { |
There was a problem hiding this comment.
I think if you add a range will be easier to understand :D
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
| private Map<String, Object> getCloudControllerRootDocumentLinks(URL controllerUrl, Map<String, String> requestTags) { |
There was a problem hiding this comment.
This method has a lot of nested structure and is long. Extract to new methods
| import reactor.netty.http.client.HttpClient; | ||
|
|
||
| @Value.Immutable | ||
| public abstract class CloudControllerRestClientFactory { |
There was a problem hiding this comment.
I think this class does many things like creating a lot of client and extracting url-s. Can you move some of the methods to a new class



Migration of the cf-java-client dependency