[go: up one dir, main page]

Skip to content

Commit

Permalink
Add toString() method to LifecycleRule (#6856)
Browse files Browse the repository at this point in the history
* Add toString() method to LifecycleRule

* Add toString() method to LifecycleRule
  • Loading branch information
JesseLovelace committed Nov 22, 2019
1 parent 08b46c2 commit 942cdf5
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ public LifecycleCondition getCondition() {
return lifecycleCondition;
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("lifecycleAction", lifecycleAction)
.add("lifecycleCondition", lifecycleCondition)
.toString();
}

@Override
public int hashCode() {
return Objects.hash(lifecycleAction, lifecycleCondition);
Expand Down Expand Up @@ -487,6 +495,17 @@ public static Builder newBuilder() {
return new Builder();
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("age", age)
.add("createBefore", createdBefore)
.add("numberofNewerVersions", numberOfNewerVersions)
.add("isLive", isLive)
.add("matchesStorageClass", matchesStorageClass)
.toString();
}

public Integer getAge() {
return age;
}
Expand Down Expand Up @@ -584,6 +603,11 @@ public abstract static class LifecycleAction implements Serializable {

public abstract String getActionType();

@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("actionType", getActionType()).toString();
}

/**
* Creates a new {@code DeleteLifecycleAction}. Blobs that meet the Condition associated with
* this action will be deleted.
Expand Down Expand Up @@ -631,6 +655,14 @@ public String getActionType() {
return TYPE;
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("actionType", getActionType())
.add("storageClass", storageClass.name())
.toString();
}

StorageClass getStorageClass() {
return storageClass;
}
Expand Down

0 comments on commit 942cdf5

Please sign in to comment.