Coverage Report - org.apache.shindig.social.opensocial.model.MediaItem
 
Classes in this File Line Coverage Branch Coverage Complexity
MediaItem
N/A
N/A
0
MediaItem$Field
0%
0/8
N/A
0
MediaItem$Type
100%
8/8
N/A
0
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements. See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership. The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License. You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied. See the License for the
 16  
  * specific language governing permissions and limitations under the License.
 17  
  */
 18  
 package org.apache.shindig.social.opensocial.model;
 19  
 
 20  
 import org.apache.shindig.social.core.model.MediaItemImpl;
 21  
 
 22  
 import com.google.inject.ImplementedBy;
 23  
 
 24  
 /**
 25  
  * A container for the media item.
 26  
  */
 27  
 @ImplementedBy(MediaItemImpl.class)
 28  
 @Exportablebean
 29  
 public interface MediaItem {
 30  
 
 31  
   /**
 32  
    * Fields for MediaItem.
 33  
    */
 34  0
   public static enum Field {
 35  
     /** the field name for mimeType. */
 36  0
     MIME_TYPE("mimeType"),
 37  
     /** the field name for type. */
 38  0
     TYPE("type"),
 39  
     /** the field name for url. */
 40  0
     URL("url");
 41  
 
 42  
     /**
 43  
      * The field name that the instance represents.
 44  
      */
 45  
     private final String jsonString;
 46  
 
 47  
     /**
 48  
      * create a field base on the an element name.
 49  
      *
 50  
      * @param jsonString the name of the element
 51  
      */
 52  0
     private Field(String jsonString) {
 53  0
       this.jsonString = jsonString;
 54  0
     }
 55  
 
 56  
     /**
 57  
      * @return a string representation of the enum.
 58  
      */
 59  
     @Override
 60  
     public String toString() {
 61  0
       return this.jsonString;
 62  
     }
 63  
   }
 64  
 
 65  
   /**
 66  
    * An enumeration of potential media types.
 67  
    */
 68  2
   public enum Type {
 69  
     /** the constant for audio types. */
 70  1
     AUDIO("audio"),
 71  
     /** the constant for image types. */
 72  1
     IMAGE("image"),
 73  
     /** the constant for video types. */
 74  1
     VIDEO("video");
 75  
 
 76  
     /**
 77  
      * The field type.
 78  
      */
 79  
     private final String jsonString;
 80  
 
 81  
     /**
 82  
      * Construct a field type based on the name.
 83  
      *
 84  
      * @param jsonString
 85  
      */
 86  3
     private Type(String jsonString) {
 87  3
       this.jsonString = jsonString;
 88  3
     }
 89  
 
 90  
     /**
 91  
      * @return a string representation of the enum.
 92  
      */
 93  
     @Override
 94  
     public String toString() {
 95  33
       return this.jsonString;
 96  
     }
 97  
   }
 98  
 
 99  
   /**
 100  
    * Get the mime type for this Media item.
 101  
    *
 102  
    * @return the mime type.
 103  
    */
 104  
   String getMimeType();
 105  
 
 106  
   /**
 107  
    * Set the mimetype for this Media Item.
 108  
    *
 109  
    * @param mimeType the mimeType
 110  
    */
 111  
   void setMimeType(String mimeType);
 112  
 
 113  
   /**
 114  
    * Get the Type of this media item, either audio, image or video.
 115  
    *
 116  
    * @return the Type of this media item
 117  
    */
 118  
   Type getType();
 119  
 
 120  
   /**
 121  
    * Get the Type of this media item, either audio, image or video.
 122  
    *
 123  
    * @param type the type of this media item
 124  
    */
 125  
   void setType(Type type);
 126  
 
 127  
   /**
 128  
    * Get a URL for the media item.
 129  
    *
 130  
    * @return the url of the media item
 131  
    */
 132  
   String getUrl();
 133  
 
 134  
   /**
 135  
    * Set a URL for the media item.
 136  
    *
 137  
    * @param url the media item URL
 138  
    */
 139  
   void setUrl(String url);
 140  
 
 141  
 }