File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
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 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import com .google .api .core .InternalApi ;
20
20
import com .google .bigtable .admin .v2 .TableName ;
21
+ import com .google .common .base .MoreObjects ;
21
22
import com .google .common .base .Objects ;
22
23
import com .google .common .base .Preconditions ;
23
24
import com .google .common .collect .ImmutableList ;
@@ -128,8 +129,10 @@ public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy toProto() {
128
129
129
130
/** Returns policy config contents as a string. */
130
131
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 ();
133
136
}
134
137
}
135
138
Original file line number Diff line number Diff line change @@ -90,11 +90,11 @@ public void testFromProto() {
90
90
assertThat (result .isAutomatedBackupEnabled ()).isTrue ();
91
91
assertEquals (
92
92
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 "
94
94
+ //
95
95
"nanos: 99\n "
96
96
+ //
97
- ", google.bigtable.admin.v2.Table. AutomatedBackupPolicy.frequency=seconds: 1\n "
97
+ ", com. google.bigtable.admin.v2.Table$ AutomatedBackupPolicy.frequency=seconds: 1\n "
98
98
+ //
99
99
"nanos: 99\n "
100
100
+ //
You can’t perform that action at this time.
0 commit comments