Computer[] notebooks = new Notebook[10]; notebooks[0] = new Notebook(); notebooks[1] = new Computer(); // <--- ArrayStoreException
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView == null) { convertView = LayoutInflater.from(getActivity()).inflate(android.R.layout.simple_list_item_1, parent, false); viewHolder = new ViewHolder(convertView); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } Notebook notebook = getItem(position); viewHolder.mTextView1.setText(notebook.getName()); return convertView; } }
boolean this_present_guid = true && this.isSetGuid(); boolean that_present_guid = true && that.isSetGuid(); if (this_present_guid || that_present_guid) { if (!(this_present_guid && that_present_guid)) boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { if (!(this_present_name && that_present_name)) boolean this_present_updateSequenceNum = true && this.isSetUpdateSequenceNum(); boolean that_present_updateSequenceNum = true && that.isSetUpdateSequenceNum(); if (this_present_updateSequenceNum || that_present_updateSequenceNum) { if (!(this_present_updateSequenceNum && that_present_updateSequenceNum)) boolean this_present_defaultNotebook = true && this.isSetDefaultNotebook(); boolean that_present_defaultNotebook = true && that.isSetDefaultNotebook(); if (this_present_defaultNotebook || that_present_defaultNotebook) { if (!(this_present_defaultNotebook && that_present_defaultNotebook)) boolean this_present_serviceCreated = true && this.isSetServiceCreated(); boolean that_present_serviceCreated = true && that.isSetServiceCreated(); if (this_present_serviceCreated || that_present_serviceCreated) { if (!(this_present_serviceCreated && that_present_serviceCreated)) boolean this_present_serviceUpdated = true && this.isSetServiceUpdated(); boolean that_present_serviceUpdated = true && that.isSetServiceUpdated(); if (this_present_serviceUpdated || that_present_serviceUpdated) { if (!(this_present_serviceUpdated && that_present_serviceUpdated))
if (other.isSetGuid()) { this.guid = other.guid; if (other.isSetName()) { this.name = other.name; this.serviceCreated = other.serviceCreated; this.serviceUpdated = other.serviceUpdated; if (other.isSetPublishing()) { this.publishing = new Publishing(other.publishing); if (other.isSetStack()) { this.stack = other.stack; if (other.isSetSharedNotebookIds()) { List<Long> __this__sharedNotebookIds = new ArrayList<Long>(); for (Long other_element : other.sharedNotebookIds) { if (other.isSetSharedNotebooks()) { List<SharedNotebook> __this__sharedNotebooks = new ArrayList<SharedNotebook>(); for (SharedNotebook other_element : other.sharedNotebooks) { if (other.isSetBusinessNotebook()) { this.businessNotebook = new BusinessNotebook(other.businessNotebook); if (other.isSetContact()) { this.contact = new User(other.contact); if (other.isSetRestrictions()) {
case 2: // NOTEBOOK if (field.type == TType.STRUCT) { this.notebook = new com.evernote.edam.type.Notebook(); this.notebook.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
log.auditLog("Start : createNotebook"); NoteStoreClient noteStoreClient = EvernoteUtil.getNoteStoreClient(messageContext); Notebook notebook = new Notebook(); notebook.setName(notebookName); notebook.setDefaultNotebook(Boolean.parseBoolean(defaultNotebook)); OMElement omResponse = EvernoteUtil.parseResponse("notebook.create.success"); OMElement omNotebook = EvernoteUtil.createOMElement("notebook"); EvernoteUtil.addAttribute(omNotebook, "guid", createdNotebook.getGuid()); omResponse.addChild(omNotebook); EvernoteUtil.preparePayload(messageContext,omResponse);
/** * @param notebook The new business notebook. * @param defaultClient The note store client, which references the user's note store. * @return The new created {@link LinkedNotebook}, which has an business ID. */ public LinkedNotebook createBusinessNotebook(@NonNull Notebook notebook, @NonNull EvernoteNoteStoreClient defaultClient) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { Notebook originalNotebook = mClient.createNotebook(notebook); List<SharedNotebook> sharedNotebooks = originalNotebook.getSharedNotebooks(); SharedNotebook sharedNotebook = sharedNotebooks.get(0); LinkedNotebook linkedNotebook = new LinkedNotebook(); linkedNotebook.setShareKey(sharedNotebook.getShareKey()); linkedNotebook.setShareName(originalNotebook.getName()); linkedNotebook.setUsername(mBusinessUserName); linkedNotebook.setShardId(mBusinessUserShardId); return defaultClient.createLinkedNotebook(linkedNotebook); }
OMElement omResponse = EvernoteUtil.parseResponse("notebook.display.success"); OMElement omNotebook = EvernoteUtil.createOMElement("notebook"); EvernoteUtil.addAttribute(omNotebook, "guid", notebook.getGuid()); EvernoteUtil.addElement(omNotebook, "notebookName", notebook.getName()); omResponse.addChild(omNotebook); EvernoteUtil.preparePayload(messageContext, omResponse);
@SuppressWarnings("unchecked") public FindNotesTask(int offset, int maxNotes, @Nullable Notebook notebook, @Nullable LinkedNotebook linkedNotebook, @Nullable String query) { super((Class) List.class); NoteFilter noteFilter = new NoteFilter(); noteFilter.setOrder(NoteSortOrder.UPDATED.getValue()); if (!TextUtils.isEmpty(query)) { noteFilter.setWords(query); } if (notebook != null) { noteFilter.setNotebookGuid(notebook.getGuid()); } mSearch = new EvernoteSearchHelper.Search() .setOffset(offset) .setMaxNotes(maxNotes) .setNoteFilter(noteFilter); if (linkedNotebook != null) { mSearch.addLinkedNotebook(linkedNotebook); } else { mSearch.addScope(EvernoteSearchHelper.Scope.PERSONAL_NOTES); } }
/** * @return {@code true} if this linked notebook is writable. */ public boolean isNotebookWritable() throws EDAMUserException, TException, EDAMSystemException, EDAMNotFoundException { Notebook notebook = getCorrespondingNotebook(); return !notebook.getRestrictions().isNoCreateNotes(); }
notebook.setName(newName); notebook.setDefaultNotebook(Boolean.parseBoolean(defaultNotebook));
case 2: // NOTEBOOK if (field.type == TType.STRUCT) { this.notebook = new com.evernote.edam.type.Notebook(); this.notebook.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
if (other.isSetGuid()) { this.guid = other.guid; if (other.isSetName()) { this.name = other.name; this.serviceCreated = other.serviceCreated; this.serviceUpdated = other.serviceUpdated; if (other.isSetPublishing()) { this.publishing = new Publishing(other.publishing); if (other.isSetStack()) { this.stack = other.stack; if (other.isSetSharedNotebookIds()) { List<Long> __this__sharedNotebookIds = new ArrayList<Long>(); for (Long other_element : other.sharedNotebookIds) { if (other.isSetSharedNotebooks()) { List<SharedNotebook> __this__sharedNotebooks = new ArrayList<SharedNotebook>(); for (SharedNotebook other_element : other.sharedNotebooks) { if (other.isSetBusinessNotebook()) { this.businessNotebook = new BusinessNotebook(other.businessNotebook); if (other.isSetContact()) { this.contact = new User(other.contact); if (other.isSetRestrictions()) {
/** * Create Linked Notebook from a Notebook * * @return {@link LinkedNotebook} with guid from server */ public LinkedNotebook createNotebook(Notebook notebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { Notebook originalNotebook = getClient().createNotebook(notebook); SharedNotebook sharedNotebook = originalNotebook.getSharedNotebooks() .get(0); LinkedNotebook linkedNotebook = new LinkedNotebook(); linkedNotebook.setShareKey(sharedNotebook.getShareKey()); linkedNotebook.setShareName(originalNotebook.getName()); linkedNotebook.setUsername(getAuthenticationResult().getUser() .getUsername()); linkedNotebook.setShardId(getAuthenticationResult().getUser().getShardId()); return getPersonalClient().createLinkedNotebook(linkedNotebook); }
protected List<NotesMetadataList> findNotesInLinkedNotebook(Search search, LinkedNotebook linkedNotebook) throws Exception { EvernoteLinkedNotebookHelper linkedNotebookHelper = mClientFactory.getLinkedNotebookHelper(linkedNotebook); Notebook correspondingNotebook = linkedNotebookHelper.getCorrespondingNotebook(); // create a deep copy so that we don't touch the initial search request values NoteFilter noteFilter = new NoteFilter(search.getNoteFilter()); noteFilter.setNotebookGuid(correspondingNotebook.getGuid()); return findAllNotes(search, linkedNotebookHelper.getClient(), noteFilter); }
/** * Checks writable permissions of {@link LinkedNotebook} on Linked account * * @param linkedNotebook */ public boolean isNotebookWritable(LinkedNotebook linkedNotebook) throws EDAMUserException, TException, EDAMSystemException, EDAMNotFoundException { Notebook notebook = getCorrespondingNotebook(linkedNotebook); return !notebook.getRestrictions().isNoCreateNotes(); }
boolean this_present_guid = true && this.isSetGuid(); boolean that_present_guid = true && that.isSetGuid(); if (this_present_guid || that_present_guid) { if (!(this_present_guid && that_present_guid)) boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { if (!(this_present_name && that_present_name)) boolean this_present_updateSequenceNum = true && this.isSetUpdateSequenceNum(); boolean that_present_updateSequenceNum = true && that.isSetUpdateSequenceNum(); if (this_present_updateSequenceNum || that_present_updateSequenceNum) { if (!(this_present_updateSequenceNum && that_present_updateSequenceNum)) boolean this_present_defaultNotebook = true && this.isSetDefaultNotebook(); boolean that_present_defaultNotebook = true && that.isSetDefaultNotebook(); if (this_present_defaultNotebook || that_present_defaultNotebook) { if (!(this_present_defaultNotebook && that_present_defaultNotebook)) boolean this_present_serviceCreated = true && this.isSetServiceCreated(); boolean that_present_serviceCreated = true && that.isSetServiceCreated(); if (this_present_serviceCreated || that_present_serviceCreated) { if (!(this_present_serviceCreated && that_present_serviceCreated)) boolean this_present_serviceUpdated = true && this.isSetServiceUpdated(); boolean that_present_serviceUpdated = true && that.isSetServiceUpdated(); if (this_present_serviceUpdated || that_present_serviceUpdated) { if (!(this_present_serviceUpdated && that_present_serviceUpdated))