[java-identity-provider COMMIT] in /trunk/idp-attribute-api/src: main/java/net/shibboleth/idp/attribute/LocalizedStri...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Apr 29 09:22:16 EDT 2013
Author: rdw
Date: Mon Apr 29 09:22:16 2013
New Revision: 4429
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4429&view=rev
Log:
Coding guidelines. Remove Optional from LocalizedStringAttributeValue
Modified:
trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValue.java
trunk/idp-attribute-api/src/test/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValueTest.java
Modified: trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValue.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValue.java?rev=4429&r1=4428&r2=4429&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValue.java (original)
+++ trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValue.java Mon Apr 29 09:22:16 2013
@@ -25,13 +25,12 @@
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import com.google.common.base.Objects;
-import com.google.common.base.Optional;
/** An optionally localized String value of an {@link Attribute}. */
public class LocalizedStringAttributeValue extends StringAttributeValue {
/** The locale of the attribute value. */
- private final Optional<Locale> valueLocale;
+ private final Locale valueLocale;
/**
* Constructor.
@@ -42,7 +41,7 @@
public LocalizedStringAttributeValue(@Nonnull @NotEmpty final String attributeValue,
@Nullable Locale attributeValueLocale) {
super(attributeValue);
- valueLocale = Optional.fromNullable(attributeValueLocale);
+ valueLocale = attributeValueLocale;
}
/**
@@ -50,7 +49,7 @@
*
* @return the local of the attribute or {@link Optional#absent()} if there no explicity locale
*/
- @Nonnull public final Optional<Locale> getValueLocale() {
+ @Nullable public final Locale getValueLocale() {
return valueLocale;
}
Modified: trunk/idp-attribute-api/src/test/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValueTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/test/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValueTest.java?rev=4429&r1=4428&r2=4429&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/test/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValueTest.java (original)
+++ trunk/idp-attribute-api/src/test/java/net/shibboleth/idp/attribute/LocalizedStringAttributeValueTest.java Mon Apr 29 09:22:16 2013
@@ -39,7 +39,7 @@
foo.add(val);
foo.add(new LocalizedStringAttributeValue("for", new Locale("en")));
foo.add(new LocalizedStringAttributeValue("for", new Locale("fr")));
- Assert.assertEquals(val.getValueLocale().get().getLanguage(), "en");
+ Assert.assertEquals(val.getValueLocale().getLanguage(), "en");
Assert.assertFalse(val.equals(null));
Assert.assertTrue(val.equals(val));
Assert.assertFalse(val.equals(new Integer(2)));
More information about the commits
mailing list