001/*
002 * Copyright 2012-2013 the original author or 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 *      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 */
016
017package org.springframework.boot.actuate.trace;
018
019import java.util.Date;
020import java.util.Map;
021
022import org.springframework.util.Assert;
023
024/**
025 * A value object representing a trace event: at a particular time with a simple (map)
026 * information. Can be used for analyzing contextual information such as HTTP headers.
027 *
028 * @author Dave Syer
029 */
030public final class Trace {
031
032        private final Date timestamp;
033
034        private final Map<String, Object> info;
035
036        public Trace(Date timestamp, Map<String, Object> info) {
037                super();
038                Assert.notNull(timestamp, "Timestamp must not be null");
039                Assert.notNull(info, "Info must not be null");
040                this.timestamp = timestamp;
041                this.info = info;
042        }
043
044        public Date getTimestamp() {
045                return this.timestamp;
046        }
047
048        public Map<String, Object> getInfo() {
049                return this.info;
050        }
051
052}