reduce code smells
This commit is contained in:
@@ -219,7 +219,7 @@ public class CfDnsClient extends CfBasicHttpClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves DNS records for the specified second-level domain (SLD) within a zone.
|
* Retrieves DNS records for the specified second-level domain (SLD) within a zone.
|
||||||
* Optionally filters by one or more DNS getRecord types.
|
* Optionally, filters by one or more DNS getRecord types.
|
||||||
*
|
*
|
||||||
* @param zone The zone entity containing information about the domain zone.
|
* @param zone The zone entity containing information about the domain zone.
|
||||||
* @param sld The second-level domain (SLD) for which to retrieve DNS records.
|
* @param sld The second-level domain (SLD) for which to retrieve DNS records.
|
||||||
@@ -446,8 +446,7 @@ public class CfDnsClient extends CfBasicHttpClient {
|
|||||||
if (types != null && types.length > 0) {
|
if (types != null && types.length > 0) {
|
||||||
Set<RecordType> allowedTypes = new HashSet<>(Arrays.asList(types));
|
Set<RecordType> allowedTypes = new HashSet<>(Arrays.asList(types));
|
||||||
filtered = recs.stream()
|
filtered = recs.stream()
|
||||||
.filter(rec -> allowedTypes.contains(RecordType.valueOf(rec.getType())))
|
.filter(rec -> allowedTypes.contains(RecordType.valueOf(rec.getType()))).toList();
|
||||||
.collect(Collectors.toList());
|
|
||||||
} else {
|
} else {
|
||||||
filtered = new ArrayList<>(recs);
|
filtered = new ArrayList<>(recs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,19 +22,6 @@ public class CfDnsClientBuilder {
|
|||||||
@Nullable
|
@Nullable
|
||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new instance of `CfDnsClientBuilder`.
|
|
||||||
*
|
|
||||||
* <p>This class serves as a builder for creating and configuring instances of a CfDnsClient. It provides
|
|
||||||
* a fluent API to set various optional configurations, such as API authentication methods and base
|
|
||||||
* URL, before constructing the client.
|
|
||||||
*
|
|
||||||
* <p>By using this constructor, you can initiate the building process with default settings, which can
|
|
||||||
* later be overridden using the provided builder methods.
|
|
||||||
*/
|
|
||||||
public CfDnsClientBuilder() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures whether an exception should be thrown when an empty result is encountered
|
* Configures whether an exception should be thrown when an empty result is encountered
|
||||||
* during operations performed by the `CfDnsClient`.
|
* during operations performed by the `CfDnsClient`.
|
||||||
|
|||||||
Reference in New Issue
Block a user