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.pojotools; 014 015import static java.util.Collections.*; 016 017import java.util.*; 018 019/** 020 * Encapsulates arguments for the {@link PojoViewer} class. 021 */ 022public class ViewArgs { 023 024 private final List<String> view; 025 026 /** 027 * Constructor. 028 * 029 * @param viewArgs 030 * View arguments. 031 * <br>Values are column names. 032 */ 033 public ViewArgs(String...viewArgs) { 034 this(Arrays.asList(viewArgs)); 035 } 036 037 /** 038 * Constructor. 039 * 040 * @param viewArgs 041 * View arguments. 042 * <br>Values are column names. 043 */ 044 public ViewArgs(Collection<String> viewArgs) { 045 this.view = unmodifiableList(new ArrayList<>(viewArgs)); 046 } 047 048 /** 049 * The view columns. 050 * 051 * <p> 052 * The view columns are the list of columns that should be displayed. 053 * An empty list implies all columns should be displayed. 054 * 055 * @return An unmodifiable list of columns to view. 056 */ 057 public List<String> getView() { 058 return view; 059 } 060}