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.rest.util;
014
015import org.apache.juneau.rest.annotation.*;
016
017/**
018 * Various reusable utility methods when working with annotations.
019 */
020public class AnnotationUtils extends org.apache.juneau.http.annotation.AnnotationUtils {
021
022   /**
023    * Returns <jk>true</jk> if the specified annotation contains all default values.
024    *
025    * @param a The annotation to check.
026    * @return <jk>true</jk> if the specified annotation contains all default values.
027    */
028   public static boolean empty(ResourceSwagger a) {
029      if (a == null)
030         return true;
031      return
032         allEmpty(a.version())
033         && allEmpty(a.title(), a.description(), a.value())
034         && empty(a.contact())
035         && empty(a.license())
036         && empty(a.externalDocs())
037         && a.tags().length == 0;
038   }
039}