Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toString() method to LifecycleRule #6856

Merged
merged 7 commits into from
Nov 22, 2019
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