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