File tree Expand file tree Collapse file tree
java-bigtable/google-cloud-bigtable/src
main/java/com/google/cloud/bigtable/admin/v2/models
test/java/com/google/cloud/bigtable/admin/v2/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919import com .google .api .core .InternalApi ;
2020import com .google .bigtable .admin .v2 .TableName ;
21+ import com .google .common .base .MoreObjects ;
2122import com .google .common .base .Objects ;
2223import com .google .common .base .Preconditions ;
2324import com .google .common .collect .ImmutableList ;
@@ -128,8 +129,10 @@ public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy toProto() {
128129
129130 /** Returns policy config contents as a string. */
130131 public String viewConfig () {
131- AutomatedBackupPolicy config = fromProto (proto );
132- return config .proto .getAllFields ().toString ();
132+ return MoreObjects .toStringHelper (this )
133+ .add (proto .getClass ().getName () + ".retention_period" , proto .getRetentionPeriod ())
134+ .add (proto .getClass ().getName () + ".frequency" , proto .getFrequency ())
135+ .toString ();
133136 }
134137 }
135138
Original file line number Diff line number Diff line change @@ -90,11 +90,11 @@ public void testFromProto() {
9090 assertThat (result .isAutomatedBackupEnabled ()).isTrue ();
9191 assertEquals (
9292 result .getAutomatedBackupPolicy ().viewConfig (),
93- "{ google.bigtable.admin.v2.Table. AutomatedBackupPolicy.retention_period=seconds: 1\n "
93+ "AutomatedBackupPolicy{com. google.bigtable.admin.v2.Table$ AutomatedBackupPolicy.retention_period=seconds: 1\n "
9494 + //
9595 "nanos: 99\n "
9696 + //
97- ", google.bigtable.admin.v2.Table. AutomatedBackupPolicy.frequency=seconds: 1\n "
97+ ", com. google.bigtable.admin.v2.Table$ AutomatedBackupPolicy.frequency=seconds: 1\n "
9898 + //
9999 "nanos: 99\n "
100100 + //
You can’t perform that action at this time.
0 commit comments