|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| Record.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | * | |
| 17 | * $Id: Record.java 571953 2007-09-02 11:04:38Z vgritsenko $ | |
| 18 | */ | |
| 19 | ||
| 20 | package org.apache.xindice.core.data; | |
| 21 | ||
| 22 | import java.util.Collections; | |
| 23 | import java.util.Map; | |
| 24 | ||
| 25 | /** | |
| 26 | * Record is a container for key/value pairs and all meta data stored | |
| 27 | * with this record in the database. | |
| 28 | * | |
| 29 | * @version $Revision: 571953 $, $Date: 2007-09-02 04:04:38 -0700 (Sun, 02 Sep 2007) $ | |
| 30 | */ | |
| 31 | public final class Record { | |
| 32 | public static final String CREATED = "created"; | |
| 33 | public static final String MODIFIED = "modified"; | |
| 34 | ||
| 35 | public static final String OWNER = "owner"; | |
| 36 | public static final String GROUP = "group"; | |
| 37 | ||
| 38 | private final Key key; | |
| 39 | private final Value value; | |
| 40 | private final Map meta; | |
| 41 | ||
| 42 | ||
| 43 | 6031 | public Record(Key key, Value value) { |
| 44 | 5898 | this.key = key; |
| 45 | 6034 | this.value = value; |
| 46 | 6033 | this.meta = Collections.EMPTY_MAP; |
| 47 | } | |
| 48 | ||
| 49 | 60381 | public Record(Key key, Value value, Map meta) { |
| 50 | 60377 | this.key = key; |
| 51 | 60384 | this.value = value; |
| 52 | 60383 | this.meta = meta; |
| 53 | } | |
| 54 | ||
| 55 | /** | |
| 56 | * getKey returns the Record's Key. | |
| 57 | * | |
| 58 | * @return The Record's Key | |
| 59 | */ | |
| 60 | 25820 | public Key getKey() { |
| 61 | 25820 | return key; |
| 62 | } | |
| 63 | ||
| 64 | /** | |
| 65 | * getValue returns the Record's Value. | |
| 66 | * | |
| 67 | * @return The Record's Value | |
| 68 | */ | |
| 69 | 50877 | public Value getValue() { |
| 70 | 50877 | return value; |
| 71 | } | |
| 72 | ||
| 73 | /** | |
| 74 | * getMetaData returns metadata about the Value. | |
| 75 | * | |
| 76 | * @param name The property name | |
| 77 | * @return The metadata value | |
| 78 | */ | |
| 79 | 111306 | public Object getMetaData(Object name) { |
| 80 | 111306 | return meta.get(name); |
| 81 | } | |
| 82 | } |
|
||||||||||