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; 014 015/** 016 * Runtime arguments common to all bean, serializer, and parser sessions. 017 */ 018public class SessionArgs { 019 020 /** 021 * Default empty session arguments. 022 */ 023 public static final SessionArgs DEFAULT = new SessionArgs(ObjectMap.EMPTY_MAP); 024 025 ObjectMap properties; 026 027 /** 028 * Constructor. 029 */ 030 public SessionArgs() {} 031 032 /** 033 * Constructor. 034 * 035 * @param properties 036 * Session-level properties. 037 * <br>These override context-level properties. 038 * <br>Can be <jk>null</jk>. 039 */ 040 public SessionArgs(ObjectMap properties) { 041 this.properties = properties != null ? properties : ObjectMap.EMPTY_MAP; 042 } 043 044 /** 045 * Session-level properties. 046 * 047 * @param properties 048 * Session-level properties. 049 * <br>These override context-level properties. 050 * <br>Can be <jk>null</jk>. 051 * @return This object (for method chaining). 052 */ 053 public SessionArgs properties(ObjectMap properties) { 054 this.properties = properties != null ? properties : ObjectMap.EMPTY_MAP; 055 return this; 056 } 057 058}