Skip to content

Commit

Permalink
switching to using lowercase for ID and URL in variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
ialarmedalien committed Feb 6, 2023
1 parent ab6d41a commit 3f7dce1
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 136 deletions.
28 changes: 14 additions & 14 deletions src/us/kbase/workspace/database/provenance/Contributor.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static ContributorType getType(final String contributorType) {
}

private final ContributorType contributorType;
private final String contributorID;
private final String contributorId;
private final String name;
private final String creditName;
private final List<Organization> affiliations;
Expand All @@ -51,13 +51,13 @@ private Contributor(
final ContributorType contributorType,
final String name,
final String creditName,
final String contributorID,
final String contributorId,
final List<Organization> affiliations,
final List<ContributorRole> contributorRoles) {
this.contributorType = contributorType;
this.name = name;
this.creditName = creditName;
this.contributorID = contributorID;
this.contributorId = contributorId;
this.affiliations = affiliations;
this.contributorRoles = contributorRoles;
}
Expand Down Expand Up @@ -94,8 +94,8 @@ public Optional<String> getCreditName() {
*
* @return the contributor ID, if present
*/
public Optional<String> getContributorID() {
return Optional.ofNullable(contributorID);
public Optional<String> getContributorId() {
return Optional.ofNullable(contributorId);
}

/**
Expand Down Expand Up @@ -131,7 +131,7 @@ public List<String> getContributorRoleStrings() {

@Override
public int hashCode() {
return Objects.hash(affiliations, contributorID, contributorRoles, contributorType, name, creditName);
return Objects.hash(affiliations, contributorId, contributorRoles, contributorType, name, creditName);
}

@Override
Expand All @@ -144,7 +144,7 @@ public boolean equals(Object obj) {
return false;
Contributor other = (Contributor) obj;
return Objects.equals(affiliations, other.affiliations)
&& Objects.equals(contributorID, other.contributorID)
&& Objects.equals(contributorId, other.contributorId)
&& Objects.equals(contributorRoles, other.contributorRoles)
&& Objects.equals(contributorType, other.contributorType)
&& Objects.equals(name, other.name)
Expand Down Expand Up @@ -190,10 +190,10 @@ public static Builder getBuilder(final String contributorType, final String name
/** A builder for a {@link Contributor}. */
public static class Builder {

private ContributorType contributorType;
private String name;
private final ContributorType contributorType;
private final String name;
private String creditName = null;
private String contributorID = null;
private String contributorId = null;
private List<Organization> affiliations = null;
private List<ContributorRole> contributorRoles = null;
private List<String> contributorRoleStrings = null;
Expand All @@ -210,12 +210,12 @@ private Builder(final ContributorType contributorType, final String name, final

/**
* Sets the ID for the contributor
* @param contributorID a persistent unique ID for the contributor
* @param contributorId a persistent unique ID for the contributor
* @return this builder
*/
public Builder withContributorID(final String contributorID) {
public Builder withContributorId(final String contributorId) {
try {
this.contributorID = Common.checkPid(contributorID, "contributorID", true);
this.contributorId = Common.checkPid(contributorId, "contributorId", true);
} catch (Exception e) {
this.errorList.add(e.getMessage());
}
Expand Down Expand Up @@ -305,7 +305,7 @@ public Contributor build() {
contributorType,
name,
creditName,
contributorID,
contributorId,
Common.dedupeSimpleList(affiliations),
Common.dedupeSimpleList(contributorRoles));
}
Expand Down
68 changes: 34 additions & 34 deletions src/us/kbase/workspace/database/provenance/FundingReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@
*/
public class FundingReference {

private final String funderID;
private final String funderId;
private final String funderName;
private final String awardID;
private final String awardId;
private final String awardTitle;
private final URL awardURL;
private final URL awardUrl;

private FundingReference(
final String funderID,
final String funderId,
final String funderName,
final String awardID,
final String awardId,
final String awardTitle,
final URL awardURL) {
this.funderID = funderID;
final URL awardUrl) {
this.funderId = funderId;
this.funderName = funderName;
this.awardID = awardID;
this.awardId = awardId;
this.awardTitle = awardTitle;
this.awardURL = awardURL;
this.awardUrl = awardUrl;
}

/**
* Gets the funder ID, for example ROR:04xm1d337.
*
* @return the funder ID, if present.
*/
public Optional<String> getFunderID() {
return Optional.ofNullable(funderID);
public Optional<String> getFunderId() {
return Optional.ofNullable(funderId);
}

/**
Expand All @@ -56,8 +56,8 @@ public String getFunderName() {
*
* @return the award ID, if present.
*/
public Optional<String> getAwardID() {
return Optional.ofNullable(awardID);
public Optional<String> getAwardId() {
return Optional.ofNullable(awardId);
}

/**
Expand All @@ -75,13 +75,13 @@ public Optional<String> getAwardTitle() {
*
* @return the award URL, if present.
*/
public Optional<URL> getAwardURL() {
return Optional.ofNullable(awardURL);
public Optional<URL> getAwardUrl() {
return Optional.ofNullable(awardUrl);
}

@Override
public int hashCode() {
return Objects.hash(awardID, awardTitle, awardURL, funderID, funderName);
return Objects.hash(awardId, awardTitle, awardUrl, funderId, funderName);
}

@Override
Expand All @@ -93,8 +93,8 @@ public boolean equals(Object obj) {
if (getClass() != obj.getClass())
return false;
FundingReference other = (FundingReference) obj;
return Objects.equals(awardID, other.awardID) && Objects.equals(awardTitle, other.awardTitle)
&& Objects.equals(awardURL, other.awardURL) && Objects.equals(funderID, other.funderID)
return Objects.equals(awardId, other.awardId) && Objects.equals(awardTitle, other.awardTitle)
&& Objects.equals(awardUrl, other.awardUrl) && Objects.equals(funderId, other.funderId)
&& Objects.equals(funderName, other.funderName);
}

Expand All @@ -113,11 +113,11 @@ public static Builder getBuilder(final String funderName) {
/** A builder for an {@link FundingReference}. */
public static class Builder {

private String funderID = null;
private String funderId = null;
private String funderName;
private String awardID = null;
private String awardId = null;
private String awardTitle = null;
private URL awardURL = null;
private URL awardUrl = null;
private List<String> errorList = new ArrayList<>();

private Builder(final String funderName) {
Expand All @@ -131,14 +131,14 @@ private Builder(final String funderName) {
/**
* Sets the ID of the funder, for example ROR:04xm1d337.
*
* @param funderID
* @param funderId
* the ID of the funder. Null or the empty string removes any
* current ID in the builder.
* @return this builder.
*/
public Builder withFunderID(final String funderID) {
public Builder withFunderId(final String funderId) {
try {
this.funderID = Common.checkPid(funderID, "funderID", true);
this.funderId = Common.checkPid(funderId, "funderId", true);
} catch (Exception e) {
this.errorList.add(e.getMessage());
}
Expand All @@ -149,13 +149,13 @@ public Builder withFunderID(final String funderID) {
* Sets the ID of the award, for example DOI:10.46936/10.25585/60000745.
* N.b. not all award IDs conform to the standard PID syntax.
*
* @param awardID
* @param awardId
* the ID of the award. Null or the empty string removes any
* current ID in the builder.
* @return this builder.
*/
public Builder withAwardID(final String awardID) {
this.awardID = Common.processString(awardID);
public Builder withAwardId(final String awardId) {
this.awardId = Common.processString(awardId);
return this;
}

Expand All @@ -176,14 +176,14 @@ public Builder withAwardTitle(final String awardTitle) {
/**
* Sets the URL for the award.
*
* @param awardURL
* @param awardUrl
* the URL for the award. Null or the empty string removes any
* current url in the builder.
* @return this builder.
*/
public Builder withAwardURL(final String awardURL) {
public Builder withAwardUrl(final String awardUrl) {
try {
this.awardURL = Common.processURL(awardURL, "awardURL");
this.awardUrl = Common.processURL(awardUrl, "awardUrl");
} catch (Exception e) {
this.errorList.add(e.getMessage());
}
Expand All @@ -193,14 +193,14 @@ public Builder withAwardURL(final String awardURL) {
/**
* Sets the URL for the award.
*
* @param awardURL
* @param awardUrl
* the URL of the award. Null removes any current url in the
* builder.
* @return this builder.
*/
public Builder withAwardURL(final URL awardURL) {
public Builder withAwardUrl(final URL awardUrl) {
try {
this.awardURL = Common.processURL(awardURL, "awardURL");
this.awardUrl = Common.processURL(awardUrl, "awardUrl");
} catch (Exception e) {
this.errorList.add(e.getMessage());
}
Expand All @@ -214,7 +214,7 @@ public Builder withAwardURL(final URL awardURL) {
*/
public FundingReference build() {
if (errorList.isEmpty()) {
return new FundingReference(funderID, funderName, awardID, awardTitle, awardURL);
return new FundingReference(funderId, funderName, awardId, awardTitle, awardUrl);
}
throw new IllegalArgumentException("Errors in FundingReference construction:\n" +
String.join("\n", errorList));
Expand Down
24 changes: 12 additions & 12 deletions src/us/kbase/workspace/database/provenance/Organization.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
*/
public class Organization {
private final String organizationName;
private final String organizationID;
private final String organizationId;

private Organization(final String organizationName, final String organizationID) {
private Organization(final String organizationName, final String organizationId) {
this.organizationName = organizationName;
this.organizationID = organizationID;
this.organizationId = organizationId;
}

/**
Expand All @@ -32,13 +32,13 @@ public String getOrganizationName() {
*
* @return the data id, if present.
*/
public Optional<String> getOrganizationID() {
return Optional.ofNullable(organizationID);
public Optional<String> getOrganizationId() {
return Optional.ofNullable(organizationId);
}

@Override
public int hashCode() {
return Objects.hash(organizationID, organizationName);
return Objects.hash(organizationId, organizationName);
}

@Override
Expand All @@ -48,7 +48,7 @@ public boolean equals(Object obj) {
if ((obj == null) || (getClass() != obj.getClass()))
return false;
Organization other = (Organization) obj;
return Objects.equals(organizationID, other.organizationID)
return Objects.equals(organizationId, other.organizationId)
&& Objects.equals(organizationName, other.organizationName);
}

Expand All @@ -66,7 +66,7 @@ public static Builder getBuilder(final String organizationName) {
public static class Builder {

private String organizationName;
private String organizationID = null;
private String organizationId = null;
private List<String> errorList = new ArrayList<>();

private Builder(final String organizationName) {
Expand All @@ -80,14 +80,14 @@ private Builder(final String organizationName) {
/**
* Set the ID of the organization, for example ROR:03rmrcq20.
*
* @param organizationID
* @param organizationId
* the organization ID. Null or the empty string removes
* any current organization ID in the builder.
* @return this builder.
*/
public Builder withOrganizationID(final String organizationID) {
public Builder withOrganizationId(final String organizationId) {
try {
this.organizationID = Common.checkPid(organizationID, "organizationID", true);
this.organizationId = Common.checkPid(organizationId, "organizationId", true);
} catch (Exception e) {
this.errorList.add(e.getMessage());
}
Expand All @@ -101,7 +101,7 @@ public Builder withOrganizationID(final String organizationID) {
*/
public Organization build() {
if (errorList.isEmpty()) {
return new Organization(organizationName, organizationID);
return new Organization(organizationName, organizationId);
}
throw new IllegalArgumentException("Errors in Organization construction:\n" +
String.join("\n", errorList));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private PermanentID(final String id, final String description, final Relationshi
*
* @return the id.
*/
public String getID() {
public String getId() {
return id;
}

Expand Down
Loading

0 comments on commit 3f7dce1

Please sign in to comment.