-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.example.pets.data; | ||
|
||
import android.provider.BaseColumns; | ||
|
||
|
||
/** | ||
* API Contract for the Pets app. | ||
*/ | ||
public final class PetContract { | ||
|
||
// To prevent someone from accidentally instantiating the contract class, | ||
// give it an empty constructor. | ||
private PetContract() { | ||
} | ||
|
||
/** | ||
* Inner class that defines constant values for the pets database table. | ||
* Each entry in the table represents a single pet. | ||
*/ | ||
public static final class PetEntry implements BaseColumns { | ||
|
||
/** | ||
* Name of database table for pets | ||
*/ | ||
public final static String TABLE_NAME = "pets"; | ||
|
||
/** | ||
* Unique ID number for the pet (only for use in the database table). | ||
* <p> | ||
* Type: INTEGER | ||
*/ | ||
public final static String _ID = BaseColumns._ID; | ||
|
||
/** | ||
* Name of the pet. | ||
* <p> | ||
* Type: TEXT | ||
*/ | ||
public final static String COLUMN_PET_NAME = "name"; | ||
|
||
/** | ||
* Breed of the pet. | ||
* <p> | ||
* Type: TEXT | ||
*/ | ||
public final static String COLUMN_PET_BREED = "breed"; | ||
|
||
/** | ||
* Gender of the pet. | ||
* <p> | ||
* The only possible values are {@link #GENDER_UNKNOWN}, {@link #GENDER_MALE}, | ||
* or {@link #GENDER_FEMALE}. | ||
* <p> | ||
* Type: INTEGER | ||
*/ | ||
public final static String COLUMN_PET_GENDER = "gender"; | ||
|
||
/** | ||
* Weight of the pet. | ||
* <p> | ||
* Type: INTEGER | ||
*/ | ||
public final static String COLUMN_PET_WEIGHT = "weight"; | ||
|
||
/** | ||
* Possible values for the gender of the pet. | ||
*/ | ||
public static final int GENDER_UNKNOWN = 0; | ||
public static final int GENDER_MALE = 1; | ||
public static final int GENDER_FEMALE = 2; | ||
} | ||
} |