Back to project page RecipeBook.
The source code is released under:
Copyright (c) 2013, Ian Lake All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Red...
If you think the Android project RecipeBook listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ianhanniballake.recipebook.model; /* w ww . j av a 2 s . co m*/ import android.content.ContentValues; import com.ianhanniballake.recipebook.provider.RecipeContract; /** * Class that manages the information associated with an instruction */ public class Instruction { private String instruction; /** * Creates a new, empty instruction */ public Instruction() { } /** * Creates a new instruction with the given text * * @param instruction * Instruction text */ public Instruction(final String instruction) { this.instruction = instruction; } /** * Setter for the instruction text * * @param instruction * Instruction text */ public void setInstruction(final String instruction) { this.instruction = instruction; } /** * Converts this instruction into appropriate ContentValues for insertion into the RecipeProvider * * @param recipeId * Mandatory recipeId to be associated with this instruction * @return ContentValues usable by the RecipeProvider */ public ContentValues toContentValues(final long recipeId) { final ContentValues contentValues = new ContentValues(); contentValues.put(RecipeContract.Instructions.COLUMN_NAME_RECIPE_ID, recipeId); contentValues.put(RecipeContract.Instructions.COLUMN_NAME_INSTRUCTION, instruction); return contentValues; } @Override public String toString() { return instruction; } }