@Path("/todo/{varX}/{varY}") @Produces({"application/xml", "application/json"}) public Todo whatEverNameYouLike(@PathParam("varX") String varX, @PathParam("varY") String varY) { Todo todo = new Todo(); todo.setSummary(varX); todo.setDescription(varY); return todo; }
Todo todo = new Todo(); todo.setSummary("This is a test"); todo.setDescription("This is a test");
$(function(){ $.getScript("/js/a.js", function() { var obj = new Todo(); }); });
def "Adding a todo increases number of Todos"() { given: "no todos in TodoStore" Todo todo = new Todo(1, "title", null, null, null) when: "we add a Todo" def response = resources.client().target("/") .request(APPLICATION_JSON_TYPE) .post(entity(todo, APPLICATION_JSON_TYPE)) then: // How do you test that the returned Todo is the same? response.getStatusInfo() == Response.Status.OK 1 * todoStore.save(_ as Todo) >> todo }
var Todo = Backbone.Model.extend({ defaults:{ title:"", completed:false } }); var todo1 = new Todo(); console.log(todo1.toJSON()) //The console shows //Object {title: "finish your assignment", completed: false} console.log(JSON.stringify(todo1)) //The console shows //{"title":"finish your assignment","completed":false}
var todo = new Todo({ task: "Get the milk", dayOfWeek: "Tuesday" });
public void onAddItem(View v) { EditText etNewItem = (EditText) findViewById(R.id.etNewItem); String itemText = etNewItem.getText().toString(); itemsAdapter.add(new Todo(itemText)); // Add items to new Adapter type etNewItem.setText(""); writeItems(); }
Todo todo = new Todo("34","34 - Summary Entered"); target.path("rest").path("todos").request().post(Entity.json(todo)); Response response = target.path("rest").path("todos").path(todo.getId()).request() .accept(MediaType.APPLICATION_XML).get(Response.class); System.out.println("\n Response Code is : "+ response.getStatus());
var todomodel = new Todo(); var todoview = new TodoView({ model: todomodel });
/** Get the Todo instance for this context. */ public static Todo instance(Context context) { Todo instance = context.get(todoKey); if (instance == null) instance = new Todo(context); return instance; }
/** Get the Todo instance for this context. */ public static Todo instance(Context context) { Todo instance = context.get(todoKey); if (instance == null) instance = new Todo(context); return instance; }
/** Get the Todo instance for this context. */ public static Todo instance(Context context) { Todo instance = context.get(todoKey); if (instance == null) instance = new Todo(context); return instance; }
describe('Todo Model', () => { beforeEach(function() { localStorageMock = sinon.mock(new LocalStorage()); global.localStorage = localStorageMock; // <-- set it here todo = new Todo(); }); afterEach(function() { delete global.localStorage; // <-- clean up here }); // ... });
/** Get the Todo instance for this context. */ public static Todo instance(Context context) { Todo instance = context.get(todoKey); if (instance == null) instance = new Todo(context); return instance; }
var model = new Todo(); var todoview = new TodoView({model: model});
List<Todo> todoItem = new ArrayList<Todo>(); DataAdapter mDbHelper = new DataAdapter(urContext); mDbHelper.createDatabase(); mDbHelper.open(); Cursor cursor = mDbHelper.getTodoData(); if (cursor.moveToFirst()) { do { Todo todo = new Todo(); todo.setName(cursor.getString(1)); todo.setNote(cursor.getString(2)); todoItem.add(todo); } while (cursor.moveToNext()); } mDbHelper.close();
public class Main { public static void main(String[] args) {public static void main(String[] args) { ApplicationContext ctx = new AnnotationConfigApplicationContext(PersistenceContext.class); TodoRepository todoRepository = ctx.getBean(TodoRepository.class); Todo todo = new Todo(); todo.setId(1l); todo.setTitle("title"); System.out.println(todoRepository); // not null todoRepository.save(todo); } }
Todo item = new Todo(); Intent i = new Intent(c, Details.class); i.putExtra("nazivTodoa", item.getTitle()); i.putExtra("datumTodoa", item.getRecordDate()); i.putExtra("idTodoa", item.getItemId());
@GET @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public Todo getXML() { Todo todo = new Todo(); todo.setSummary("This is my first todo"); todo.setDescription("This is my first todo"); return todo; }