001/** 002 * Copyright 2014 Tampere University of Technology, Pori Department 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 * http://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 core.tut.pori.http.headers; 017 018import org.apache.commons.lang3.StringUtils; 019 020/** 021 * A HTTPHeader, as defined by http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html 022 * 023 */ 024public class HTTPHeader { 025 private String _name = null; 026 private String _value = null; 027 028 /** 029 * The inherited class should have no-args default constructor 030 */ 031 public HTTPHeader(){ 032 // nothing needed 033 } 034 035 /** 036 * 037 * @return true if this parameter has one or more values 038 */ 039 public boolean hasValue(){ 040 return !StringUtils.isBlank(_value); 041 } 042 043 /** 044 * @return the value 045 */ 046 public String getValue() { 047 return _value; 048 } 049 050 /** 051 * @param value the value to set 052 */ 053 public void setValue(String value) { 054 _value = value; 055 } 056 057 /** 058 * @return the name 059 */ 060 public String getName() { 061 return _name; 062 } 063 064 /** 065 * @param name the name to set 066 */ 067 public void setName(String name) { 068 _name = name; 069 } 070}