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 org.apache.juneau.internal.*; 016 017/** 018 * Used for assertion calls against arbitrary POJOs. 019 * 020 * <h5 class='section'>Example:</h5> 021 * <p class='bcode w800'> 022 * <jc>// Validates the specified POJO is the specified type.</jc> 023 * <jsm>assertObject</jsm>(<jv>myPojo</jv>).instanceOf(MyBean.<jk>class</jk>); 024 * </p> 025 */ 026@FluentSetters(returns="ObjectAssertion") 027public class ObjectAssertion extends FluentObjectAssertion<ObjectAssertion> { 028 029 /** 030 * Creator. 031 * 032 * @param value The object being wrapped. 033 * @return A new {@link ObjectAssertion} object. 034 */ 035 public static ObjectAssertion create(Object value) { 036 return new ObjectAssertion(value); 037 } 038 039 /** 040 * Creator. 041 * 042 * @param value The object being wrapped. 043 */ 044 public ObjectAssertion(Object value) { 045 super(value, null); 046 } 047 048 @Override 049 protected ObjectAssertion returns() { 050 return this; 051 } 052 053 // <FluentSetters> 054 055 @Override /* GENERATED - Assertion */ 056 public ObjectAssertion msg(String msg, Object...args) { 057 super.msg(msg, args); 058 return this; 059 } 060 061 @Override /* GENERATED - Assertion */ 062 public ObjectAssertion stderr() { 063 super.stderr(); 064 return this; 065 } 066 067 @Override /* GENERATED - Assertion */ 068 public ObjectAssertion stdout() { 069 super.stdout(); 070 return this; 071 } 072 073 // </FluentSetters> 074}