public class CustomApp extends Application{ private Storage mStorage; @Override public void onCreate() { super.onCreate(); mStorage = new Storage(); } public Storage getStorage(){ return this.mStorage; } }
static public Storage instance() { if(_instance != null) { return _instance; } _instance = new Storage(); if (file.exists()) { deserialize_Storage_data_from_file(); } return _instance; }
function Collection(){ var that = new Storage(); // initialize whatever's necessary, using "that" return that; }
function Collection(){ return new Storage(); }
class Setting { constructor() { var storage = new Storage(); this.fooSubject = new ReplaySubject(1); this.fooSubject.subscribe((val) => { storage.set('foo', val); }); } get observable() { return this.fooSubject.asObservable(); }; store(val) { this.fooSubject.next(val); } }
Collection.prototype = new Storage(); // real inheritance
(function() { window.onload = function() { document.getElementById('buttonCreate').onclick = function() { var topicValue = document.getElementById("create-topic").value; var statusValue = document.getElementById("create-status").value; var descriptionValue = document.getElementById("create-description").value; var storage = new Storage("ticket"); var ticket = { topic: topicValue, status: statusValue, description: descriptionValue }; storage.set(ticket); } } })();
Storage storage = null; try { //... if (storage == null) { storage = new Storage(new Record(j, Integer.parseInt(ContentCount), RowContent)); } else { storage.addRecord(j, Integer.parseInt(ContentCount), RowContent)); } } catch (...) { //... }
public class Main extends JavaPlugin { Storage myStorage = null; public void onEnable() { final FileConfiguration config = this.getConfig(); config.options().copyDefaults(true); saveConfig(); myStorage = new Storage(this); }
Storage s = new Storage(); ArrayList<String> list = new ArrayList<>(); s.put("name", list);
DisplayForm dF = new DisplayForm(); Storage st = new Storage();
Storage s = new Storage(); s.<IOrganization>find("hello world", true);
public static void main(String[] args) { Storage data = new Storage(); data.Store("Jack", 60, 182); data.Store("Peter", 70, 176); }
public static void main(String[] args) { Storage data = new Storage(); data.Store("Jack", 60, 182); data.Store("Peter", 70, 176); }
public static void main(String[] args) { Storage data = new Storage(); data.Store("Jack", 60, 182); data.Store("Peter", 70, 176); data.printList(); }
Storage storage = new Storage(); User john = new User("John"); storage.put(john, 25); System.out.println(storage.get(new User("John"))); // we modify the reference which is used as a key in our map john.toUpperCase(); System.out.println(john.getName()); System.out.println(storage.get(new User("John")));
new Storage(mockTransport, Transport.getJsonFactory(), new RetryHttpRequestInitializer())); gcsUtil.remove(Arrays.asList("gs://some-bucket/already-deleted"));
new Storage(mockTransport, Transport.getJsonFactory(), new RetryHttpRequestInitializer())); gcsUtil.fileSizes(ImmutableList.of(GcsPath.fromComponents("testbucket", "testobject")));
@Test public void testFileSizeWhenFileNotFoundNonBatch() throws Exception { MockLowLevelHttpResponse notFoundResponse = new MockLowLevelHttpResponse(); notFoundResponse.setContent(""); notFoundResponse.setStatusCode(HttpStatusCodes.STATUS_CODE_NOT_FOUND); MockHttpTransport mockTransport = new MockHttpTransport.Builder().setLowLevelHttpResponse(notFoundResponse).build(); GcsOptions pipelineOptions = gcsOptionsWithTestCredential(); GcsUtil gcsUtil = pipelineOptions.getGcsUtil(); gcsUtil.setStorageClient(new Storage(mockTransport, Transport.getJsonFactory(), null)); thrown.expect(FileNotFoundException.class); gcsUtil.fileSize(GcsPath.fromComponents("testbucket", "testobject")); }
gcsUtil.setStorageClient(new Storage(mockTransport, Transport.getJsonFactory(), null)); gcsUtil.fileSizes(ImmutableList.of(GcsPath.fromComponents("testbucket", "testobject")));