JCLOUDS-653: Address Guava 18 deprecations

Mostly renaming Objects.toStringHelper to MoreObjects.toStringHelper.
This commit is contained in:
Andrew Gaul 2014-08-08 11:49:42 -07:00
parent a6ad6d463d
commit 5c1e36e5d1
5 changed files with 14 additions and 10 deletions

View File

@ -26,9 +26,9 @@ import com.google.common.collect.Sets;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import static com.google.common.base.Objects.ToStringHelper; import static com.google.common.base.MoreObjects.ToStringHelper;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState; import static com.google.common.base.Preconditions.checkState;

View File

@ -16,10 +16,11 @@
*/ */
package org.jclouds.oauth.v2.domain; package org.jclouds.oauth.v2.domain;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
/** /**
@ -121,7 +122,7 @@ public class Header {
return string().toString(); return string().toString();
} }
protected Objects.ToStringHelper string() { protected MoreObjects.ToStringHelper string() {
return toStringHelper(this).omitNullValues().add("signerAlgorithm", signerAlgorithm) return toStringHelper(this).omitNullValues().add("signerAlgorithm", signerAlgorithm)
.add("type", type); .add("type", type);
} }

View File

@ -16,13 +16,14 @@
*/ */
package org.jclouds.oauth.v2.domain; package org.jclouds.oauth.v2.domain;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import org.jclouds.domain.Credentials; import org.jclouds.domain.Credentials;
import java.security.PrivateKey; import java.security.PrivateKey;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
/** /**
@ -121,7 +122,7 @@ public class OAuthCredentials extends Credentials {
return string().toString(); return string().toString();
} }
protected Objects.ToStringHelper string() { protected MoreObjects.ToStringHelper string() {
return toStringHelper(this).omitNullValues().add("identity", identity) return toStringHelper(this).omitNullValues().add("identity", identity)
.add("credential", credential != null ? credential.hashCode() : null).add("privateKey", .add("credential", credential != null ? credential.hashCode() : null).add("privateKey",
privateKey.hashCode()); privateKey.hashCode());

View File

@ -16,12 +16,13 @@
*/ */
package org.jclouds.oauth.v2.domain; package org.jclouds.oauth.v2.domain;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import java.beans.ConstructorProperties; import java.beans.ConstructorProperties;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
/** /**
@ -141,7 +142,7 @@ public class Token {
return string().toString(); return string().toString();
} }
protected Objects.ToStringHelper string() { protected MoreObjects.ToStringHelper string() {
return toStringHelper(this).omitNullValues().add("accessToken", accessToken) return toStringHelper(this).omitNullValues().add("accessToken", accessToken)
.add("tokenType", tokenType).add("expiresIn", expiresIn); .add("tokenType", tokenType).add("expiresIn", expiresIn);
} }

View File

@ -16,10 +16,11 @@
*/ */
package org.jclouds.oauth.v2.domain; package org.jclouds.oauth.v2.domain;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
/** /**
@ -122,7 +123,7 @@ public class TokenRequest {
return string().toString(); return string().toString();
} }
protected Objects.ToStringHelper string() { protected MoreObjects.ToStringHelper string() {
return toStringHelper(this).omitNullValues().add("header", header) return toStringHelper(this).omitNullValues().add("header", header)
.add("claimSet", claimSet); .add("claimSet", claimSet);
} }