001package org.apache.archiva.rest.api.model; 002/* 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, 014 * software distributed under the License is distributed on an 015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 016 * KIND, either express or implied. See the License for the 017 * specific language governing permissions and limitations 018 * under the License. 019 */ 020 021import org.apache.archiva.policies.PolicyOption; 022 023import javax.xml.bind.annotation.XmlRootElement; 024import java.io.Serializable; 025import java.util.List; 026 027/** 028 * @author Olivier Lamy 029 * @since 1.4-M3 030 */ 031@XmlRootElement( name = "policyInformation" ) 032public class PolicyInformation 033 implements Serializable 034{ 035 private List<PolicyOption> options; 036 037 private PolicyOption defaultOption; 038 039 private String id; 040 041 private String name; 042 043 public PolicyInformation() 044 { 045 // no op 046 } 047 048 public PolicyInformation(List<PolicyOption> options, PolicyOption defaultOption, String id, String name ) 049 { 050 this.options = options; 051 this.defaultOption = defaultOption; 052 this.id = id; 053 this.name = name; 054 } 055 056 public List<PolicyOption> getOptions() 057 { 058 return options; 059 } 060 061 public void setOptions( List<PolicyOption> options ) 062 { 063 this.options = options; 064 } 065 066 public PolicyOption getDefaultOption() 067 { 068 return defaultOption; 069 } 070 071 public void setDefaultOption( PolicyOption defaultOption ) 072 { 073 this.defaultOption = defaultOption; 074 } 075 076 public String getId() 077 { 078 return id; 079 } 080 081 public void setId( String id ) 082 { 083 this.id = id; 084 } 085 086 public String getName() 087 { 088 return name; 089 } 090 091 public void setName( String name ) 092 { 093 this.name = name; 094 } 095 096 @Override 097 public String toString() 098 { 099 final StringBuilder sb = new StringBuilder(); 100 sb.append( "PolicyInformation" ); 101 sb.append( "{options=" ).append( options ); 102 sb.append( ", defaultOption='" ).append( defaultOption ).append( '\'' ); 103 sb.append( ", id='" ).append( id ).append( '\'' ); 104 sb.append( ", name='" ).append( name ).append( '\'' ); 105 sb.append( '}' ); 106 return sb.toString(); 107 } 108}