Skip to content

Commit

Permalink
Use Javabeans In Getters and Setters (Azure#5338)
Browse files Browse the repository at this point in the history
* Method names now use Javabeans

* Rename setters and getters in file and queue

* Regenerate blob

* Getter setters for core-netty, core-amqp, core-management - code compiles

* Cleaned up API renaming

* Additional fixes for Blob renaming

* Small test fixes for blobs

* Rename getter and setter for queue and ile

* Getters and setters for KeyVault

* Make some changes to commons.

* Getters and setters for Event Hubs

* Make changes for common

* More cleanup

* Fixed linting file and queue

* Getters and setters for AppConfiguration, compilation cleanup

* Merge conflicts

* Misc getter and setter renaming

* Fixing storage tests

* Some linting changes

* Fix exception decoder

* Passing Storage Blob tests

* Rename booleans to use is prefix

* Some linting cleanup

* Fixing more Blob tests

* Update KV certificates with new names

* Merge from mainline and fixed all tests

* Fixed more boolean field

* Update names after rebase

* checkin blob fix

* Small error fix

* linting issues

* keyvault compilation error

* Fixed failed live tests for blob
  • Loading branch information
alzimmermsft authored and srnagar committed Sep 12, 2019
1 parent 84720ac commit 9430735
Show file tree
Hide file tree
Showing 789 changed files with 12,420 additions and 12,386 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ page at http://checkstyle.sourceforge.net/config.html -->
<!-- Fluent method checks:
(1) A method returns an instance of the class, and that have one parameter,
(2) should not start with the words in the avoidStartWords list.-->
<module name="com.azure.tools.checkstyle.checks.FluentMethodNameCheck">
<property name="avoidStartWords" value="with,set"/>
</module>
<!-- <module name="com.azure.tools.checkstyle.checks.FluentMethodNameCheck">-->
<!-- <property name="avoidStartWords" value="with,set"/>-->
<!-- </module>-->
</module>
</module>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public ConfigurationClientBuilder endpoint(String endpoint) {
*/
public ConfigurationClientBuilder credential(ConfigurationClientCredentials credential) {
this.credential = Objects.requireNonNull(credential);
this.endpoint = credential.baseUri();
this.endpoint = credential.getBaseUri();
return this;
}

Expand Down Expand Up @@ -297,7 +297,7 @@ private URL getBuildEndpoint(ConfigurationClientCredentials buildCredentials) {
if (endpoint != null) {
return endpoint;
} else if (buildCredentials != null) {
return buildCredentials.baseUri();
return buildCredentials.getBaseUri();
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ConfigurationClientCredentials(String connectionString)
*
* @return The base URI of the configuration service extracted from connection string provided.
*/
public URL baseUri() {
public URL getBaseUri() {
return this.credentials.baseUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class ConfigurationSettingPage implements Page<ConfigurationSetting
* @return The link to the next page or {@code null} if there are no more resources to fetch.
*/
@Override
public String nextLink() {
public String getNextLink() {
return this.nextLink;
}

Expand All @@ -35,7 +35,7 @@ public String nextLink() {
* @return The list of {@link ConfigurationSetting ConfigurationSettings}.
*/
@Override
public List<ConfigurationSetting> items() {
public List<ConfigurationSetting> getItems() {
return items;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
import java.util.Objects;

/**
* ConfigurationSetting is a resource identified by unique combination of {@link #key() key} and {@link #label() label}.
* By default, the label is {@code null}. To explicitly reference the default label use {@link #NO_LABEL}.
* ConfigurationSetting is a resource identified by unique combination of {@link #getKey() key} and {@link #getLabel()
* label}. By default, the label is {@code null}. To explicitly reference the default label use {@link #NO_LABEL}.
*/
@Fluent
public class ConfigurationSetting {
/**
* The default label for configuration settings is the label, "\0".
* Users use this value when they want to explicitly reference a configuration setting that has no label.
* This gets URL encoded as "%00".
* The default label for configuration settings is the label, "\0". Users use this value when they want to
* explicitly reference a configuration setting that has no label. This gets URL encoded as "%00".
*/
public static final String NO_LABEL = "\0";

Expand Down Expand Up @@ -58,7 +57,7 @@ public ConfigurationSetting() {
*
* @return The key for this configuration setting.
*/
public String key() {
public String getKey() {
return key;
}

Expand All @@ -68,7 +67,7 @@ public String key() {
* @param key The name of the configuration key.
* @return ConfigurationSetting object itself.
*/
public ConfigurationSetting key(String key) {
public ConfigurationSetting setKey(String key) {
this.key = key;
return this;
}
Expand All @@ -78,18 +77,18 @@ public ConfigurationSetting key(String key) {
*
* @return The label of this setting.
*/
public String label() {
public String getLabel() {
return label;
}

/**
* Sets the label of this configuration setting. {@link #NO_LABEL} is the default label used when this value is
* not set.
* Sets the label of this configuration setting. {@link #NO_LABEL} is the default label used when this value is not
* set.
*
* @param label The label of this configuration setting.
* @return The updated ConfigurationSetting object.
*/
public ConfigurationSetting label(String label) {
public ConfigurationSetting setLabel(String label) {
this.label = label;
return this;
}
Expand All @@ -99,7 +98,7 @@ public ConfigurationSetting label(String label) {
*
* @return The value of this configuration setting.
*/
public String value() {
public String getValue() {
return value;
}

Expand All @@ -109,7 +108,7 @@ public String value() {
* @param value The value to associate with this configuration setting.
* @return The updated ConfigurationSetting object.
*/
public ConfigurationSetting value(String value) {
public ConfigurationSetting setValue(String value) {
this.value = value;
return this;
}
Expand All @@ -119,7 +118,7 @@ public ConfigurationSetting value(String value) {
*
* @return The content type of this setting.
*/
public String contentType() {
public String getContentType() {
return contentType;
}

Expand All @@ -129,7 +128,7 @@ public String contentType() {
* @param contentType The content type of this configuration setting.
* @return The updated ConfigurationSetting object.
*/
public ConfigurationSetting contentType(String contentType) {
public ConfigurationSetting setContentType(String contentType) {
this.contentType = contentType;
return this;
}
Expand All @@ -139,7 +138,7 @@ public ConfigurationSetting contentType(String contentType) {
*
* @return etag The etag for the setting.
*/
public String etag() {
public String getETag() {
return etag;
}

Expand All @@ -149,7 +148,7 @@ public String etag() {
* @param etag The etag for the configuration setting.
* @return The updated ConfigurationSetting object.
*/
public ConfigurationSetting etag(String etag) {
public ConfigurationSetting setETag(String etag) {
this.etag = etag;
return this;
}
Expand All @@ -159,16 +158,15 @@ public ConfigurationSetting etag(String etag) {
*
* @return The time when the configuration was last modified.
*/
public OffsetDateTime lastModified() {
public OffsetDateTime getLastModified() {
return lastModified;
}

/**
* Gets whether or not the configuration setting is locked. If the setting is locked, then no modifications can be
* made to this setting.
*
* This is a <b>readonly</b> property. It is populated from responses from the Azure App Configuration
* service.
* This is a <b>readonly</b> property. It is populated from responses from the Azure App Configuration service.
*
* @return true if locked; false otherwise.
*/
Expand All @@ -181,7 +179,7 @@ public boolean isLocked() {
*
* @return tags Gets tags for this configuration setting.
*/
public Map<String, String> tags() {
public Map<String, String> getTags() {
return tags;
}

Expand All @@ -191,7 +189,7 @@ public Map<String, String> tags() {
* @param tags The tags to add to this configuration setting.
* @return The updated ConfigurationSetting object.
*/
public ConfigurationSetting tags(Map<String, String> tags) {
public ConfigurationSetting setTags(Map<String, String> tags) {
this.tags = tags;
return this;
}
Expand Down Expand Up @@ -238,12 +236,12 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(this.key,
this.label,
this.value,
this.etag,
this.lastModified,
this.locked,
this.contentType,
this.tags);
this.label,
this.value,
this.etag,
this.lastModified,
this.locked,
this.contentType,
this.tags);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @see ConfigurationAsyncClient#listSettingRevisions(SettingSelector)
* @see ConfigurationClient#listSettingRevisions(SettingSelector)
* @see SettingSelector#range(Range)
* @see SettingSelector#setRange(Range)
*/
@Immutable
public class Range {
Expand All @@ -33,14 +33,14 @@ public Range(int start, int end) {
/**
* @return the start of the range.
*/
public int start() {
public int getStart() {
return start;
}

/**
* @return the end of the range.
*/
public int end() {
public int getEnd() {
return end;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@
*/
public enum SettingFields {
/**
* Populates the {@link ConfigurationSetting#key()} from the service.
* Populates the {@link ConfigurationSetting#getKey()} from the service.
*/
KEY,
/**
* Populates the {@link ConfigurationSetting#label()} from the service.
* Populates the {@link ConfigurationSetting#getLabel()} from the service.
*/
LABEL,
/**
* Populates the {@link ConfigurationSetting#value()} from the service.
* Populates the {@link ConfigurationSetting#getValue()} from the service.
*/
VALUE,
/**
* Populates the {@link ConfigurationSetting#contentType()} from the service.
* Populates the {@link ConfigurationSetting#getContentType()} from the service.
*/
CONTENT_TYPE,
/**
* Populates the {@link ConfigurationSetting#etag()} from the service.
* Populates the {@link ConfigurationSetting#getETag()} from the service.
*/
ETAG,
/**
* Populates the {@link ConfigurationSetting#lastModified()} from the service.
* Populates the {@link ConfigurationSetting#getLastModified()} from the service.
*/
LAST_MODIFIED,
/**
* Populates the {@link ConfigurationSetting#isLocked()} from the service.
*/
LOCKED,
/**
* Populates the {@link ConfigurationSetting#tags()} from the service.
* Populates the {@link ConfigurationSetting#getTags()} from the service.
*/
TAGS;

Expand Down
Loading

0 comments on commit 9430735

Please sign in to comment.