File tree Expand file tree Collapse file tree
branches/pubsub-alpha/gcloud-java-compute/src/main/java/com/google/gcloud/compute Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22refs/heads/master: 36a62ef856d199f8efd09501b5ba65c422c01f23
33refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
5- refs/heads/pubsub-alpha: 1d5f1716fd633b5d971c1e468dc336f79e21805b
5+ refs/heads/pubsub-alpha: 44fedd64a2bfd05d4ce7742b798eff58875e241a
66refs/heads/update-datastore: 47aae517c2cb33f1dccd909adaced73ec9d0f4df
77refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
88refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
Original file line number Diff line number Diff line change @@ -94,10 +94,16 @@ public int hashCode() {
9494
9595 @ Override
9696 public boolean equals (Object obj ) {
97- return obj instanceof DiskTypeId
98- && baseEquals ((DiskTypeId ) obj )
99- && Objects .equals (zone , ((DiskTypeId ) obj ).zone )
100- && Objects .equals (diskType , ((DiskTypeId ) obj ).diskType );
97+ if (obj == this ) {
98+ return true ;
99+ }
100+ if (!(obj instanceof DiskTypeId )) {
101+ return false ;
102+ }
103+ DiskTypeId other = (DiskTypeId ) obj ;
104+ return baseEquals (other )
105+ && Objects .equals (zone , other .zone )
106+ && Objects .equals (diskType , other .diskType );
101107 }
102108
103109 @ Override
Original file line number Diff line number Diff line change 2323import java .util .Objects ;
2424
2525/**
26- * Interface for Google Compute Engine forwarding rule identities.
26+ * Base class for Google Compute Engine forwarding rule identities.
2727 */
2828public abstract class ForwardingRuleId extends ResourceId {
2929
Original file line number Diff line number Diff line change @@ -100,10 +100,16 @@ public int hashCode() {
100100
101101 @ Override
102102 public boolean equals (Object obj ) {
103- return obj instanceof InstanceId
104- && baseEquals ((InstanceId ) obj )
105- && Objects .equals (zone , ((InstanceId ) obj ).zone )
106- && Objects .equals (instance , ((InstanceId ) obj ).instance );
103+ if (obj == this ) {
104+ return true ;
105+ }
106+ if (!(obj instanceof InstanceId )) {
107+ return false ;
108+ }
109+ InstanceId other = (InstanceId ) obj ;
110+ return baseEquals (other )
111+ && Objects .equals (zone , other .zone )
112+ && Objects .equals (instance , other .instance );
107113 }
108114
109115 @ Override
Original file line number Diff line number Diff line change @@ -78,9 +78,14 @@ public int hashCode() {
7878
7979 @ Override
8080 public boolean equals (Object obj ) {
81- return obj instanceof LicenseId
82- && baseEquals ((LicenseId ) obj )
83- && Objects .equals (license , ((LicenseId ) obj ).license );
81+ if (obj == this ) {
82+ return true ;
83+ }
84+ if (!(obj instanceof LicenseId )) {
85+ return false ;
86+ }
87+ LicenseId other = (LicenseId ) obj ;
88+ return baseEquals (other ) && Objects .equals (license , other .license );
8489 }
8590
8691 @ Override
Original file line number Diff line number Diff line change @@ -96,10 +96,16 @@ public int hashCode() {
9696
9797 @ Override
9898 public boolean equals (Object obj ) {
99- return obj instanceof MachineTypeId
100- && baseEquals ((MachineTypeId ) obj )
101- && Objects .equals (zone , ((MachineTypeId ) obj ).zone )
102- && Objects .equals (machineType , ((MachineTypeId ) obj ).machineType );
99+ if (obj == this ) {
100+ return true ;
101+ }
102+ if (!(obj instanceof MachineTypeId )) {
103+ return false ;
104+ }
105+ MachineTypeId other = (MachineTypeId ) obj ;
106+ return baseEquals (other )
107+ && Objects .equals (zone , other .zone )
108+ && Objects .equals (machineType , other .machineType );
103109 }
104110
105111 @ Override
Original file line number Diff line number Diff line change @@ -76,9 +76,14 @@ public int hashCode() {
7676
7777 @ Override
7878 public boolean equals (Object obj ) {
79- return obj instanceof RegionAddressId
80- && baseEquals ((RegionAddressId ) obj )
81- && Objects .equals (region , ((RegionAddressId ) obj ).region );
79+ if (obj == this ) {
80+ return true ;
81+ }
82+ if (!(obj instanceof RegionAddressId )) {
83+ return false ;
84+ }
85+ RegionAddressId other = (RegionAddressId ) obj ;
86+ return baseEquals (other ) && Objects .equals (region , other .region );
8287 }
8388
8489 @ Override
Original file line number Diff line number Diff line change @@ -92,9 +92,14 @@ public int hashCode() {
9292
9393 @ Override
9494 public boolean equals (Object obj ) {
95- return obj instanceof RegionForwardingRuleId
96- && baseEquals ((RegionForwardingRuleId ) obj )
97- && Objects .equals (region , ((RegionForwardingRuleId ) obj ).region );
95+ if (obj == this ) {
96+ return true ;
97+ }
98+ if (!(obj instanceof RegionForwardingRuleId )) {
99+ return false ;
100+ }
101+ RegionForwardingRuleId other = (RegionForwardingRuleId ) obj ;
102+ return baseEquals (other ) && Objects .equals (region , other .region );
98103 }
99104
100105 @ Override
Original file line number Diff line number Diff line change @@ -83,9 +83,14 @@ public int hashCode() {
8383
8484 @ Override
8585 public boolean equals (Object obj ) {
86- return obj instanceof RegionId
87- && baseEquals ((RegionId ) obj )
88- && Objects .equals (region , ((RegionId ) obj ).region );
86+ if (obj == this ) {
87+ return true ;
88+ }
89+ if (!(obj instanceof RegionId )) {
90+ return false ;
91+ }
92+ RegionId other = (RegionId ) obj ;
93+ return baseEquals (other ) && Objects .equals (region , other .region );
8994 }
9095
9196 @ Override
Original file line number Diff line number Diff line change @@ -76,9 +76,14 @@ public int hashCode() {
7676
7777 @ Override
7878 public boolean equals (Object obj ) {
79- return obj instanceof RegionOperationId
80- && baseEquals ((RegionOperationId ) obj )
81- && Objects .equals (region , ((RegionOperationId ) obj ).region );
79+ if (obj == this ) {
80+ return true ;
81+ }
82+ if (!(obj instanceof RegionOperationId )) {
83+ return false ;
84+ }
85+ RegionOperationId other = (RegionOperationId ) obj ;
86+ return baseEquals (other ) && Objects .equals (region , other .region );
8287 }
8388
8489 @ Override
You can’t perform that action at this time.
0 commit comments