001/*
002 * oauth2-oidc-sdk
003 *
004 * Copyright 2012-2016, Connect2id Ltd and contributors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
007 * this file except in compliance with the License. You may obtain a copy of the
008 * License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed
013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
015 * specific language governing permissions and limitations under the License.
016 */
017
018package com.nimbusds.openid.connect.sdk.claims;
019
020
021import net.jcip.annotations.Immutable;
022
023import com.nimbusds.oauth2.sdk.id.Identifier;
024
025
026/**
027 * The end-user's gender: Values defined by the OpenID Connect specification 
028 * are {@link #FEMALE} and {@link #MALE} ({@code gender}). Other values may be
029 * used when neither of the defined values are applicable.
030 */
031@Immutable
032public class Gender extends Identifier {
033
034        
035        /**
036         * Female gender claim value.
037         */
038        public static final Gender FEMALE = new Gender("female");
039        
040        
041        /**
042         * Male gender claim value.
043         */
044        public static final Gender MALE = new Gender("male");
045        
046         
047        /**
048         * Creates a new gender with the specified value.
049         *
050         * @param value The gender value. Must not be {@code null}.
051         */
052        public Gender(final String value) {
053        
054                super(value);
055        }
056
057
058        @Override
059        public boolean equals(final Object object) {
060        
061                return object instanceof Gender &&
062                       this.toString().equals(object.toString());
063        }
064}