All Downloads are FREE. Search and download functionalities are using the official Maven repository.

syncloud.google.docs.model.Category Maven / Gradle / Ivy

The newest version!
package syncloud.google.docs.model;

import com.google.api.client.util.Key;

import java.util.List;

public class Category {

    @Key("@scheme")
    public String scheme;

    @Key("@term")
    public String term;

    @Key("@label")
    public String label;

    public static Category find(List categories, CategoryScheme categoryScheme){
        if (categories == null)
            return null;

        for(Category category : categories)
            if (category.scheme.equalsIgnoreCase(categoryScheme.getScheme()))
                return category;

        return null;
    }
    
    public static Category find(List categories, CategoryScheme categoryScheme, CategoryTerm term){
        if (categories == null)
            return null;

        for(Category category : categories)
            if (category.scheme.equalsIgnoreCase(categoryScheme.getScheme()) && category.term.equalsIgnoreCase(term.getTerm()))
                return category;

        return null;
    }

    public static Category folder(){
        Category category = new Category();
        category.scheme = CategoryScheme.KIND.getScheme();
        category.term =  CategoryTerm.FOLDER.getTerm();
        return category;
    }

    public static Category file(){
            Category category = new Category();
            category.scheme = CategoryScheme.KIND.getScheme();
            category.term =  CategoryTerm.FILE.getTerm();
            return category;
        }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy