Skip to content

Instantly share code, notes, and snippets.

@ZahraaElhaj
Forked from udacityandroid/StoreContract.java
Created March 21, 2018 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZahraaElhaj/98870cf6be7cf0e4f04a82680234f9c1 to your computer and use it in GitHub Desktop.
Save ZahraaElhaj/98870cf6be7cf0e4f04a82680234f9c1 to your computer and use it in GitHub Desktop.
Example contract class for a table which contains data about the store's headphones stock
public final class StoreContract {
public static abstract class HeadphoneEntry implements BaseColumns {
public static final String TABLE_NAME = "headphones";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_PRICE = "price";
public static final String COLUMN_STYLE = "style";
public static final String COLUMN_IN_STOCK = "in_stock";
public static final String COLUMN_DESCRIPTION = "description";
/**
* Possible values for the style of the headphone.
*/
public static final int STYLE_EAR_BUD = 0;
public static final int STYLE_ON_EAR = 1;
public static final int STYLE_OVER_EAR = 2;
public static final int STYLE_BONE_CONDUCTION = 3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment