001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.html; 018 019/** 020 * Identifies possible float values for {@link HtmlDocSerializer.Builder#asideFloat(AsideFloat)}. 021 * 022 * <h5 class='section'>See Also:</h5><ul> 023 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/HtmlBasics">HTML Basics</a> 024 * </ul> 025 */ 026public enum AsideFloat { 027 028 /** 029 * Float right of main contents. 030 */ 031 LEFT, 032 033 /** 034 * Float left of main contents. 035 */ 036 RIGHT, 037 038 /** 039 * Float above main contents. 040 */ 041 TOP, 042 043 /** 044 * Float below main contents. 045 */ 046 BOTTOM, 047 048 /** 049 * Default value (defaults to {@link #LEFT} 050 */ 051 DEFAULT; 052 053 /** 054 * Returns <jk>true</jk> if value matches this enum. 055 * 056 * @param value The value to check against. 057 * @return <jk>true</jk> if value matches this enum. 058 */ 059 public boolean is(AsideFloat value) { 060 return this == value; 061 } 062 063 /** 064 * Returns <jk>true</jk> if any of the values match this enum. 065 * 066 * @param values The values to check against. 067 * @return <jk>true</jk> if value matches this enum. 068 */ 069 public boolean isAny(AsideFloat...values) { 070 for (AsideFloat v : values) 071 if (is(v)) 072 return true; 073 return false; 074 } 075}