/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. * */ package com.amazon.photosharing.rest.vo; import com.amazon.photosharing.dao.Share; import javax.xml.bind.annotation.XmlRootElement; import java.util.Date; @XmlRootElement public class ShareResult { private Long mediaId, id, userId, albumId; private String name, hash, shareUrl; private Long sharedWithUserId; private Date expireDate; public ShareResult(Share share) { if (share != null) { mediaId = share.getMedia().getId(); name = share.getName(); sharedWithUserId = share.getSharedWith().getId(); id = share.getId(); userId = share.getUser().getId(); albumId = share.getAlbum().getId(); expireDate = share.getExpires(); hash = share.getHash(); shareUrl = share.getShareUrl(); } } public Long getMediaId() { return mediaId; } public void setMediaId(Long mediaId) { this.mediaId = mediaId; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getAlbumId() { return albumId; } public void setAlbumId(Long albumId) { this.albumId = albumId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getHash() { return hash; } public void setHash(String hash) { this.hash = hash; } public String getShareUrl() { return shareUrl; } public void setShareUrl(String shareUrl) { this.shareUrl = shareUrl; } public Long getSharedWithUserId() { return sharedWithUserId; } public void setSharedWithUserId(Long sharedWithUserId) { this.sharedWithUserId = sharedWithUserId; } public Date getExpireDate() { return expireDate; } public void setExpireDate(Date expireDate) { this.expireDate = expireDate; } }