%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
org.apache.jcs.admin.CacheElementInfo |
|
|
1 | package org.apache.jcs.admin; |
|
2 | ||
3 | /* |
|
4 | * Licensed to the Apache Software Foundation (ASF) under one |
|
5 | * or more contributor license agreements. See the NOTICE file |
|
6 | * distributed with this work for additional information |
|
7 | * regarding copyright ownership. The ASF licenses this file |
|
8 | * to you under the Apache License, Version 2.0 (the |
|
9 | * "License"); you may not use this file except in compliance |
|
10 | * with the License. You may obtain a copy of the License at |
|
11 | * |
|
12 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
13 | * |
|
14 | * Unless required by applicable law or agreed to in writing, |
|
15 | * software distributed under the License is distributed on an |
|
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
17 | * KIND, either express or implied. See the License for the |
|
18 | * specific language governing permissions and limitations |
|
19 | * under the License. |
|
20 | */ |
|
21 | ||
22 | /** |
|
23 | * Stores info on a cache element for the template |
|
24 | */ |
|
25 | 16 | public class CacheElementInfo |
26 | { |
|
27 | /** element key */ |
|
28 | 16 | String key = null; |
29 | ||
30 | /** is it eternal */ |
|
31 | 16 | boolean eternal = false; |
32 | ||
33 | /** when it was created */ |
|
34 | 16 | String createTime = null; |
35 | ||
36 | /** max life */ |
|
37 | 16 | long maxLifeSeconds = -1; |
38 | ||
39 | /** when it will expire */ |
|
40 | 16 | long expiresInSeconds = -1; |
41 | ||
42 | /** |
|
43 | * @return a string representation of the key |
|
44 | */ |
|
45 | public String getKey() |
|
46 | { |
|
47 | 24 | return this.key; |
48 | } |
|
49 | ||
50 | /** |
|
51 | * @return true if the item does not expire |
|
52 | */ |
|
53 | public boolean isEternal() |
|
54 | { |
|
55 | 8 | return this.eternal; |
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return the time the object was created |
|
60 | */ |
|
61 | public String getCreateTime() |
|
62 | { |
|
63 | 8 | return this.createTime; |
64 | } |
|
65 | ||
66 | /** |
|
67 | * Ignored if isEternal |
|
68 | * @return the longest this object can live. |
|
69 | */ |
|
70 | public long getMaxLifeSeconds() |
|
71 | { |
|
72 | 8 | return this.maxLifeSeconds; |
73 | } |
|
74 | ||
75 | /** |
|
76 | * Ignored if isEternal |
|
77 | * @return how many seconds until this object expires. |
|
78 | */ |
|
79 | public long getExpiresInSeconds() |
|
80 | { |
|
81 | 8 | return this.expiresInSeconds; |
82 | } |
|
83 | ||
84 | /** |
|
85 | * @return string info on the item |
|
86 | */ |
|
87 | public String toString() |
|
88 | { |
|
89 | 8 | StringBuffer buf = new StringBuffer(); |
90 | 8 | buf.append( "\nCacheElementInfo " ); |
91 | 8 | buf.append( "\n Key [" + getKey() + "]" ); |
92 | 8 | buf.append( "\n Eternal [" + isEternal() + "]" ); |
93 | 8 | buf.append( "\n CreateTime [" + getCreateTime() + "]" ); |
94 | 8 | buf.append( "\n MaxLifeSeconds [" + getMaxLifeSeconds() + "]" ); |
95 | 8 | buf.append( "\n ExpiresInSeconds [" + getExpiresInSeconds() + "]" ); |
96 | ||
97 | 8 | return buf.toString(); |
98 | } |
|
99 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |