001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.shared.kerberos.components; 021 022 023import org.apache.directory.shared.kerberos.KerberosTime; 024import org.apache.directory.shared.kerberos.codec.types.LastReqType; 025 026 027/** 028 * The data structure hold into the LastReq element 029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 030 */ 031public class LastReqEntry 032{ 033 /** The LastReq type. */ 034 private LastReqType lrType; 035 036 /** The LastReq value */ 037 private KerberosTime lrValue; 038 039 040 /** 041 * Creates a new instance of LastReqEntry 042 */ 043 public LastReqEntry() 044 { 045 } 046 047 048 /** 049 * Creates a new instance of LastReqEntry 050 * @param lrType The LastRequest type 051 * @param lrValue The associated Time 052 */ 053 public LastReqEntry( LastReqType lrType, KerberosTime lrValue ) 054 { 055 this.lrType = lrType; 056 this.lrValue = lrValue; 057 } 058 059 060 /** 061 * @return the LastReqType 062 */ 063 public LastReqType getLrType() 064 { 065 return lrType; 066 } 067 068 069 /** 070 * @param lrType the lrType to set 071 */ 072 public void setLrType( LastReqType lrType ) 073 { 074 this.lrType = lrType; 075 } 076 077 078 /** 079 * @return the lr-value 080 */ 081 public KerberosTime getLrValue() 082 { 083 return lrValue; 084 } 085 086 087 /** 088 * @param lrValue the lrValue to set 089 */ 090 public void setLrValue( KerberosTime lrValue ) 091 { 092 this.lrValue = lrValue; 093 } 094 095 096 /** 097 * @see Object#toString() 098 */ 099 public String toString( String tabs ) 100 { 101 StringBuilder sb = new StringBuilder(); 102 103 sb.append( tabs ).append( "LastRequestEntry : {\n" ); 104 sb.append( tabs ).append( " lrType : " ).append( lrType ).append( "\n" ); 105 sb.append( tabs ).append( " lrValue : " ).append( lrValue ).append( "\n" ); 106 sb.append( tabs ).append( "}" ); 107 108 return sb.toString(); 109 } 110 111 112 /** 113 * @see Object#toString() 114 */ 115 public String toString() 116 { 117 return toString( "" ); 118 } 119}