001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.http.annotation;
014
015import java.lang.annotation.*;
016
017/**
018 * A concrete implementation of the {@link Contact} annotation.
019 */
020public class ContactAnnotation implements Contact {
021
022   private String name="", url="", email="";
023   private String[] value={};
024
025   @Override /* Annotation */
026   public Class<? extends Annotation> annotationType() {
027      return Contact.class;
028   }
029
030   @Override /* Contact */
031   public String name() {
032      return name;
033   }
034
035   /**
036    * Sets the <c>name</c> property on this annotation.
037    *
038    * @param value The new value for this property.
039    * @return This object (for method chaining).
040    */
041   public ContactAnnotation name(String value) {
042      this.name = value;
043      return this;
044   }
045
046   @Override /* Contact */
047   public String url() {
048      return url;
049   }
050
051   /**
052    * Sets the <c>url</c> property on this annotation.
053    *
054    * @param value The new value for this property.
055    * @return This object (for method chaining).
056    */
057   public ContactAnnotation url(String value) {
058      this.url = value;
059      return this;
060   }
061
062   @Override /* Contact */
063   public String email() {
064      return email;
065   }
066
067   /**
068    * Sets the <c>email</c> property on this annotation.
069    *
070    * @param value The new value for this property.
071    * @return This object (for method chaining).
072    */
073   public ContactAnnotation email(String value) {
074      this.email = value;
075      return this;
076   }
077
078   @Override /* Contact */
079   public String[] value() {
080      return value;
081   }
082
083   /**
084    * Sets the <c>value</c> property on this annotation.
085    *
086    * @param value The new value for this property.
087    * @return This object (for method chaining).
088    */
089   public ContactAnnotation value(String[]  value) {
090      this.value = value;
091      return this;
092   }
093}