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.assertions; 014 015import java.io.*; 016import java.util.function.*; 017 018import org.apache.juneau.internal.*; 019import org.apache.juneau.serializer.*; 020 021/** 022 * Used for assertion calls against booleans. 023 * 024 * <h5 class='section'>Test Methods:</h5> 025 * <p> 026 * <ul class='javatree'> 027 * <li class='jc'>{@link FluentBooleanAssertion} 028 * <ul class='javatreec'> 029 * <li class='jm'>{@link FluentBooleanAssertion#isTrue() isTrue()} 030 * <li class='jm'>{@link FluentBooleanAssertion#isFalse() isFalse()} 031 * </ul> 032 * <li class='jc'>{@link FluentComparableAssertion} 033 * <ul class='javatreec'> 034 * <li class='jm'>{@link FluentComparableAssertion#isGt(Comparable) isGt(Comparable)} 035 * <li class='jm'>{@link FluentComparableAssertion#isGte(Comparable) isGte(Comparable)} 036 * <li class='jm'>{@link FluentComparableAssertion#isLt(Comparable) isLt(Comparable)} 037 * <li class='jm'>{@link FluentComparableAssertion#isLte(Comparable) isLte(Comparable)} 038 * <li class='jm'>{@link FluentComparableAssertion#isBetween(Comparable,Comparable) isBetween(Comparable,Comparable)} 039 * </ul> 040 * <li class='jc'>{@link FluentObjectAssertion} 041 * <ul class='javatreec'> 042 * <li class='jm'>{@link FluentObjectAssertion#isExists() isExists()} 043 * <li class='jm'>{@link FluentObjectAssertion#is(Object) is(Object)} 044 * <li class='jm'>{@link FluentObjectAssertion#is(Predicate) is(Predicate)} 045 * <li class='jm'>{@link FluentObjectAssertion#isNot(Object) isNot(Object)} 046 * <li class='jm'>{@link FluentObjectAssertion#isAny(Object...) isAny(Object...)} 047 * <li class='jm'>{@link FluentObjectAssertion#isNotAny(Object...) isNotAny(Object...)} 048 * <li class='jm'>{@link FluentObjectAssertion#isNull() isNull()} 049 * <li class='jm'>{@link FluentObjectAssertion#isNotNull() isNotNull()} 050 * <li class='jm'>{@link FluentObjectAssertion#isString(String) isString(String)} 051 * <li class='jm'>{@link FluentObjectAssertion#isJson(String) isJson(String)} 052 * <li class='jm'>{@link FluentObjectAssertion#isSame(Object) isSame(Object)} 053 * <li class='jm'>{@link FluentObjectAssertion#isSameJsonAs(Object) isSameJsonAs(Object)} 054 * <li class='jm'>{@link FluentObjectAssertion#isSameSortedJsonAs(Object) isSameSortedJsonAs(Object)} 055 * <li class='jm'>{@link FluentObjectAssertion#isSameSerializedAs(Object, WriterSerializer) isSameSerializedAs(Object, WriterSerializer)} 056 * <li class='jm'>{@link FluentObjectAssertion#isType(Class) isType(Class)} 057 * <li class='jm'>{@link FluentObjectAssertion#isExactType(Class) isExactType(Class)} 058 * </ul> 059 * </ul> 060 * 061 * <h5 class='section'>Transform Methods:</h5> 062 * <p> 063 * <ul class='javatree'> 064 * <li class='jc'>{@link FluentObjectAssertion} 065 * <ul class='javatreec'> 066 * <li class='jm'>{@link FluentObjectAssertion#asString() asString()} 067 * <li class='jm'>{@link FluentObjectAssertion#asString(WriterSerializer) asString(WriterSerializer)} 068 * <li class='jm'>{@link FluentObjectAssertion#asString(Function) asString(Function)} 069 * <li class='jm'>{@link FluentObjectAssertion#asJson() asJson()} 070 * <li class='jm'>{@link FluentObjectAssertion#asJsonSorted() asJsonSorted()} 071 * <li class='jm'>{@link FluentObjectAssertion#asTransformed(Function) asApplied(Function)} 072 * <li class='jm'>{@link FluentObjectAssertion#asAny() asAny()} 073 * </ul> 074 * </ul> 075 * 076 * <h5 class='section'>Configuration Methods:</h5> 077 * <p> 078 * <ul class='javatree'> 079 * <li class='jc'>{@link Assertion} 080 * <ul class='javatreec'> 081 * <li class='jm'>{@link Assertion#setMsg(String, Object...) setMsg(String, Object...)} 082 * <li class='jm'>{@link Assertion#setOut(PrintStream) setOut(PrintStream)} 083 * <li class='jm'>{@link Assertion#setSilent() setSilent()} 084 * <li class='jm'>{@link Assertion#setStdOut() setStdOut()} 085 * <li class='jm'>{@link Assertion#setThrowable(Class) setThrowable(Class)} 086 * </ul> 087 * </ul> 088 * 089 * <h5 class='section'>See Also:</h5><ul> 090 * <li class='link'><a class="doclink" href="../../../../index.html#ja.Overview">Overview > juneau-assertions > Overview</a> 091 * </ul> 092 */ 093@FluentSetters(returns="BooleanAssertion") 094public class BooleanAssertion extends FluentBooleanAssertion<BooleanAssertion> { 095 096 //----------------------------------------------------------------------------------------------------------------- 097 // Static 098 //----------------------------------------------------------------------------------------------------------------- 099 100 /** 101 * Static creator. 102 * 103 * @param value 104 * The object being tested. 105 * <br>Can be <jk>null</jk>. 106 * @return A new assertion object. 107 */ 108 public static BooleanAssertion create(Boolean value) { 109 return new BooleanAssertion(value); 110 } 111 112 //----------------------------------------------------------------------------------------------------------------- 113 // Instance 114 //----------------------------------------------------------------------------------------------------------------- 115 116 /** 117 * Constructor. 118 * 119 * @param value 120 * The object being tested. 121 * <br>Can be <jk>null</jk>. 122 */ 123 public BooleanAssertion(Boolean value) { 124 super(value, null); 125 } 126 127 //----------------------------------------------------------------------------------------------------------------- 128 // Fluent setters 129 //----------------------------------------------------------------------------------------------------------------- 130 131 // <FluentSetters> 132 133 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 134 public BooleanAssertion setMsg(String msg, Object...args) { 135 super.setMsg(msg, args); 136 return this; 137 } 138 139 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 140 public BooleanAssertion setOut(PrintStream value) { 141 super.setOut(value); 142 return this; 143 } 144 145 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 146 public BooleanAssertion setSilent() { 147 super.setSilent(); 148 return this; 149 } 150 151 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 152 public BooleanAssertion setStdOut() { 153 super.setStdOut(); 154 return this; 155 } 156 157 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 158 public BooleanAssertion setThrowable(Class<? extends java.lang.RuntimeException> value) { 159 super.setThrowable(value); 160 return this; 161 } 162 163 // </FluentSetters> 164}