use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncDeleteBookBookname method syncDeleteBookBookname.
public static void syncDeleteBookBookname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
BookName name = BookName.of("[SHELF]", "[BOOK]");
libraryServiceClient.deleteBook(name);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class AsyncListBooksPaged method asyncListBooksPaged.
public static void asyncListBooksPaged() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
ListBooksRequest request = ListBooksRequest.newBuilder().setParent(ShelfName.of("[SHELF_ID]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
while (true) {
ListBooksResponse response = libraryServiceClient.listBooksCallable().call(request);
for (Book element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class AsyncGetBook method asyncGetBook.
public static void asyncGetBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
GetBookRequest request = GetBookRequest.newBuilder().setName(BookName.of("[SHELF]", "[BOOK]").toString()).build();
ApiFuture<Book> future = libraryServiceClient.getBookCallable().futureCall(request);
// Do something.
Book response = future.get();
}
}
use of com.google.example.library.v1.Book in project FAST_JAVA by KIMTAEKJUN.
the class ArrayListTest method main.
public static void main(String[] args) {
// Book의 ArrayList 객체 배열 선언
ArrayList<Book> library = new ArrayList<>();
// add() → 객체를 리스트에 추가
library.add(new Book("태백산맥1", "조정래"));
library.add(new Book("태백산맥2", "조정래"));
library.add(new Book("태백산맥3", "조정래"));
library.add(new Book("태백산맥4", "조정래"));
library.add(new Book("태백산맥5", "조정래"));
// size() → 리스트에 들어있는 원소 수, get() → 인덱스의 위치에 있는 객체를 리턴
for (int i = 0; i < library.size(); i++) {
//
library.get(i).showInfo();
}
}
use of com.google.example.library.v1.Book in project wicket by apache.
the class WicketTesterTest method bookmarkableLink.
/**
* @throws Exception
*/
@Test
public void bookmarkableLink() throws Exception {
// for WebPage without default constructor, I define a TestPageSource to
// let the page be instatiated lately.
Book mockBook = new Book("xxId", "xxName");
tester.startPage(new ViewBook(mockBook));
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.clickLink("link");
tester.assertRenderedPage(CreateBook.class);
}
Aggregations