001/*
002 * Copyright (c) 2013 Maxim Yunusov
003 *    Licensed under the Apache License, Version 2.0 (the "License");
004 *    you may not use this file except in compliance with the License.
005 *    You may obtain a copy of the License at
006 *
007 *        http://www.apache.org/licenses/LICENSE-2.0
008 *
009 *    Unless required by applicable law or agreed to in writing, software
010 *    distributed under the License is distributed on an "AS IS" BASIS,
011 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 *    See the License for the specific language governing permissions and
013 *    limitations under the License.
014 */
015
016package org.maxur.perfmodel.backend.domain;
017
018import javax.xml.bind.annotation.XmlRootElement;
019import java.io.Serializable;
020import java.util.List;
021
022import static java.util.Arrays.stream;
023import static java.util.stream.Collectors.toList;
024
025/**
026 * @author Maxim Yunusov
027 * @version 1.0
028 * @since <pre>11/25/13</pre>
029 */
030@XmlRootElement
031public class Incident implements Serializable {
032
033    private static final long serialVersionUID = 2368849548039200044L;
034
035    private String message;
036
037    @SuppressWarnings("UnusedDeclaration")
038    public Incident() {
039    }
040
041    public Incident(final String message) {
042        this.message = message;
043    }
044
045    public static List<Incident> incidents(final String... messages) {
046        return stream(messages).map(Incident::new).collect(toList());
047    }
048
049    @SuppressWarnings("UnusedDeclaration")
050    public String getMessage() {
051        return message;
052    }
053}