001/*
002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and others.
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 * Contributors:
017 *     Nuxeo
018 */
019
020package org.nuxeo.ecm.platform.ui.web.auth.service;
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 {
032
033    @XNode("@src")
034    protected String src;
035
036    @XNode("@type")
037    protected String type;
038
039    public String getType() {
040        return type;
041    }
042
043    public void setType(String type) {
044        this.type = type;
045    }
046
047    public String getSrc() {
048        return src;
049    }
050
051    public void setSrc(String src) {
052        this.src = Framework.expandVars(src);
053    }
054
055    @Override
056    public boolean equals(Object o) {
057        if (this == o) {
058            return true;
059        }
060        if (o == null || getClass() != o.getClass()) {
061            return false;
062        }
063
064        LoginVideo that = (LoginVideo) o;
065
066        if (src != null ? !src.equals(that.src) : that.src != null) {
067            return false;
068        }
069        return !(type != null ? !type.equals(that.type) : that.type != null);
070    }
071
072    @Override
073    public int hashCode() {
074        int result = src != null ? src.hashCode() : 0;
075        result = 31 * result + (type != null ? type.hashCode() : 0);
076        return result;
077    }
078
079    @Override
080    public LoginVideo clone() {
081        LoginVideo clone = new LoginVideo();
082        clone.src = src;
083        clone.type = type;
084        return clone;
085    }
086
087}