Package 

Class MenigaUserCategory

  • All Implemented Interfaces:
    android.os.Parcelable , java.io.Serializable , java.lang.Cloneable

    
    public class MenigaUserCategory
    extends MenigaCategory implements Serializable
                        

    Represents a user created category, directly inherits from MenigaCategory.

    Copyright 2017 Meniga Iceland Inc.

    • Method Summary

      Modifier and Type Method Description
      void setName(String name) Sets a new name for this user category
      void setIsFixedExpenses(boolean isFixedExpenses) Sets if this user category is fixed expenses or not
      void setCategoryType(CategoryType categoryType) Sets the type of this user category (EXPENSES, INCOME, SAVINGS, EXCLUDED)
      void setParentCategoryId(long parentCategoryId) Set a new parent category id for this child user category
      Result<Void> delete() Delets this user created category
      Result<Void> update() Updates this user category, fields that have setters can be updated
      Result<MenigaCategory> refresh() Fetches the server version of this object and updates all fields in this object with the server values, essentially syncing it with the server
      static Result<MenigaUserCategory> create(String name, boolean isFixedExpenses, long parentId) Creates a new category for a user under another category
      static Result<MenigaUserCategory> create(String name, boolean isFixedExpenses, CategoryType type) Creates a new category for a user that is a root category
      • Methods inherited from class com.meniga.sdk.models.categories.MenigaCategory

        describeContents, equals, fetch, fetch, fetch, fetchTree, getBudgetGenerationType, getCategoryContextId, getCategoryDisplay, getCategoryRank, getCategoryType, getChildren, getDisplayData, getFixedIcon, getId, getIsFixedExpenses, getIsPublic, getName, getOrderId, getOtherCategoryName, getParent, getParentCategoryId, hashCode, setOperator, toString, writeToParcel
      • Methods inherited from class android.os.Parcelable

        describeContents, writeToParcel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • setName

         void setName(String name)

        Sets a new name for this user category

        Parameters:
        name - The new name of this user category
      • setIsFixedExpenses

         void setIsFixedExpenses(boolean isFixedExpenses)

        Sets if this user category is fixed expenses or not

        Parameters:
        isFixedExpenses - Wheather this user category is fixed expenses or not
      • setCategoryType

         void setCategoryType(CategoryType categoryType)

        Sets the type of this user category (EXPENSES, INCOME, SAVINGS, EXCLUDED)

        Parameters:
        categoryType - The new type of this user category
      • setParentCategoryId

         void setParentCategoryId(long parentCategoryId)

        Set a new parent category id for this child user category

        Parameters:
        parentCategoryId - The new parent category id of this child user category
      • update

         Result<Void> update()

        Updates this user category, fields that have setters can be updated

      • refresh

         Result<MenigaCategory> refresh()

        Fetches the server version of this object and updates all fields in this object with the server values, essentially syncing it with the server

      • create

         static Result<MenigaUserCategory> create(String name, boolean isFixedExpenses, long parentId)

        Creates a new category for a user under another category

        Parameters:
        name - The name of the new user category
        isFixedExpenses - Whether the new user category is a fixed expense or not
        parentId - The id of the parent category under which this user category will be positioned
      • create

         static Result<MenigaUserCategory> create(String name, boolean isFixedExpenses, CategoryType type)

        Creates a new category for a user that is a root category

        Parameters:
        name - The name of the new user category
        isFixedExpenses - Whether the new user category is a fixed expense or not
        type - The type of the new category, income, expenses, savings or excluded