001/* 002 * Copyright 2017-2021 original authors 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package io.micronaut.maven.openapi; 017 018/** 019 * A class used to specify parameter mapping. 020 * Parameter mapping would map a given parameter to a specific type and name. 021 */ 022public final class ResponseBodyMapping { 023 024 /** 025 * The response header name that triggers the change of response type. 026 */ 027 private String headerName; 028 029 /** 030 * The type in which will be used as the response type. The type must take 031 * a single type parameter, which will be the original body. 032 */ 033 private String mappedBodyType; 034 035 /** 036 * Whether the mapped body type needs to be supplied list items as property. 037 */ 038 private boolean isListWrapper; 039 040 /** 041 * Whether the mapped response body type required validation. 042 */ 043 private boolean isValidated; 044 045 public String getHeaderName() { 046 return headerName; 047 } 048 049 public void setHeaderName(String headerName) { 050 this.headerName = headerName; 051 } 052 053 public String getMappedBodyType() { 054 return mappedBodyType; 055 } 056 057 public void setMappedBodyType(String mappedBodyType) { 058 this.mappedBodyType = mappedBodyType; 059 } 060 061 public boolean isListWrapper() { 062 return isListWrapper; 063 } 064 065 public void setListWrapper(boolean listWrapper) { 066 isListWrapper = listWrapper; 067 } 068 069 public boolean isValidated() { 070 return isValidated; 071 } 072 073 public void setValidated(boolean validated) { 074 isValidated = validated; 075 } 076 077}