001/*
002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo
016 */
017
018package org.nuxeo.ecm.platform.ui.web.auth.service;
019
020import java.io.Serializable;
021
022import org.nuxeo.common.xmap.annotation.XNode;
023import org.nuxeo.common.xmap.annotation.XObject;
024import org.nuxeo.runtime.api.Framework;
025
026/**
027 * @author <a href="mailto:ak@nuxeo.com">Arnaud Kervern</a>
028 * @since 7.10
029 */
030@XObject("loginVideo")
031public class LoginVideo implements Serializable {
032
033    private static final long serialVersionUID = 1L;
034
035    @XNode("@src")
036    protected String src;
037
038    @XNode("@type")
039    protected String type;
040
041    public String getType() {
042        return type;
043    }
044
045    public void setType(String type) {
046        this.type = type;
047    }
048
049    public String getSrc() {
050        return src;
051    }
052
053    public void setSrc(String src) {
054        this.src = Framework.expandVars(src);
055    }
056
057    @Override
058    public boolean equals(Object o) {
059        if (this == o) {
060            return true;
061        }
062        if (o == null || getClass() != o.getClass()) {
063            return false;
064        }
065
066        LoginVideo that = (LoginVideo) o;
067
068        if (src != null ? !src.equals(that.src) : that.src != null) {
069            return false;
070        }
071        return !(type != null ? !type.equals(that.type) : that.type != null);
072    }
073
074    @Override
075    public int hashCode() {
076        int result = src != null ? src.hashCode() : 0;
077        result = 31 * result + (type != null ? type.hashCode() : 0);
078        return result;
079    }
080
081    @Override
082    public LoginVideo clone() {
083        LoginVideo clone = new LoginVideo();
084        clone.src = src;
085        clone.type = type;
086        return clone;
087    }
088
089}