conversation
listlengths
2
2
[ { "content": "Calls the specified Stitch function, and decodes the response into an instance of the specified\ntype. The response will be decoded using the codec registry given.\n\n@param name the name of the Stitch function to call.\n@param args the arguments to pass to the Stitch function.\n@param requestTime...
[ { "content": "Starts all streams.", "role": "user" }, { "content": "public void start() {\n instanceLock.writeLock().lock();\n try {\n for (final Map.Entry<MongoNamespace, NamespaceChangeStreamListener> streamerEntry :\n nsStreamers.entrySet()) {\n streamerEntry.getValue()...
[ { "content": "Stops all streams.", "role": "user" }, { "content": "public void stop() {\n instanceLock.writeLock().lock();\n try {\n for (final NamespaceChangeStreamListener streamer : nsStreamers.values()) {\n streamer.stop();\n }\n } finally {\n instanceLock.writeLoc...
[ { "content": "Requests that the given namespace be started listening to for change events.\n\n@param namespace the namespace to listen for change events on.", "role": "user" }, { "content": "public void addNamespace(final MongoNamespace namespace) {\n this.instanceLock.writeLock().lock();\n tr...
[ { "content": "Requests that the given namespace stopped being listened to for change events.\n\n@param namespace the namespace to stop listening for change events on.", "role": "user" }, { "content": "@Override\n public void removeNamespace(final MongoNamespace namespace) {\n this.instanceLock.w...
[ { "content": "Returns the latest change events for a given namespace.\n\n@param namespace the namespace to get events for.\n@return the latest change events for a given namespace.", "role": "user" }, { "content": "public Map<BsonValue, ChangeEvent<BsonDocument>> getEventsForNamespace(\n final M...
[ { "content": "If there is an unprocessed change event for a particular document ID, fetch it from the\nappropriate namespace change stream listener, and remove it. By reading the event here, we are\nassuming it will be processed by the consumer.\n\n@return the latest unprocessed change event for the given docum...
[ { "content": "A document that is paused no longer has remote updates applied to it.\nAny local updates to this document cause it to be thawed. An example of pausing a document\nis when a conflict is being resolved for that document and the handler throws an exception.\n\n@param isPaused whether or not this conf...
[ { "content": "Sets that there are some pending writes that occurred at a time for an associated\nlocally emitted change event. This variant maintains the last version set.\n\n@param atTime the time at which the write occurred.\n@param changeEvent the description of the write/change.", "role": "user" ...
[ { "content": "Possibly coalesces the newest change event to match the user's original intent. For example,\nan unsynchronized insert and update is still an insert.\n\n@param lastUncommittedChangeEvent the last change event known about for a document.\n@param newestChangeEvent the newest change event kn...
[ { "content": "Returns the current version info for a provided remote document.\n@param remoteDocument the remote BSON document from which to extract version info\n@return a DocumentVersionInfo", "role": "user" }, { "content": "static DocumentVersionInfo getRemoteVersionInfo(final BsonDocument remote...
[ { "content": "Returns a BSON version document representing a new version with a new instance ID, and\nversion counter of zero.\n@return a BsonDocument representing a synchronization version", "role": "user" }, { "content": "static BsonDocument getFreshVersionDocument() {\n final BsonDocument vers...
[ { "content": "Returns the version document of the given document, if any; returns null otherwise.\n@param document the document to get the version from.\n@return the version of the given document, if any; returns null otherwise.", "role": "user" }, { "content": "static BsonDocument getDocumentVersio...
[ { "content": "Returns a query filter for the given document _id and version. The version is allowed to be\nnull. The query will match only if there is either no version on the document in the database\nin question if we have no reference of the version or if the version matches the database's\nversion.\n\n@para...
[ { "content": "Given a DocumentVersionInfo, returns a BSON document representing the next version. This means\nand incremented version count for a non-empty version, or a fresh version document for an\nempty version.\n@return a BsonDocument representing a synchronization version", "role": "user" }, { ...
[ { "content": "Gets a collection.\n\n@param collectionName the name of the collection to return\n@return the collection", "role": "user" }, { "content": "public RemoteMongoCollection<Document> getCollection(final String collectionName) {\n return new RemoteMongoCollectionImpl<>(proxy.getCollection...
[ { "content": "Convert a SSE to a Stitch SSE\n@param event SSE to convert\n@param decoder decoder for decoding data\n@param <T> type to decode data to\n@return a Stitch server-sent event", "role": "user" }, { "content": "static <T> StitchEvent<T> fromEvent(final Event event,\n ...
[ { "content": "Process the next event in a given stream.\n@return the fully processed event\n@throws IOException if a stream is in the wrong state, IO errors can be thrown", "role": "user" }, { "content": "protected final Event processEvent() throws IOException {\n while (true) {\n String lin...
[ { "content": "Private helper method which decodes the Stitch error from the body of an HTTP `Response`\nobject. If the error is successfully decoded, this function will throw the error for the end\nuser to eventually consume. If the error cannot be decoded, this is likely not an error from\nthe Stitch server, a...
[ { "content": "Initializes the Stitch SDK so that app clients can be created.\n\n@param context An Android context value.", "role": "user" }, { "content": "public static void initialize(final Context context) {\n if (!initialized.compareAndSet(false, true)) {\n return;\n }\n\n applicati...
[ { "content": "Gets an app client by its client app id if it has been initialized; throws if none can be\nfound.\n\n@param clientAppId the client app id of the app client to get.\n@return the app client associated with the client app id.", "role": "user" }, { "content": "public static StitchAppClient...
[ { "content": "Opens the stream in a background thread.", "role": "user" }, { "content": "public void start() {\n nsLock.writeLock().lock();\n try {\n if (runnerThread != null) {\n return;\n }\n runnerThread =\n new Thread(new NamespaceChangeStreamRunner(\n ...
[ { "content": "Stops the background stream thread.", "role": "user" }, { "content": "public void stop() {\n if (runnerThread == null) {\n return;\n }\n\n runnerThread.interrupt();\n\n nsLock.writeLock().lock();\n try {\n if (runnerThread == null) {\n return;\n }\n...
[ { "content": "Open the event stream\n\n@return true if successfully opened, false if not", "role": "user" }, { "content": "boolean openStream() throws InterruptedException, IOException {\n logger.info(\"stream START\");\n final boolean isOpen;\n final Set<BsonValue> idsToWatch = nsConfig.ge...
[ { "content": "Returns the latest change events, and clears them from the change stream listener.\n\n@return the latest change events.", "role": "user" }, { "content": "@SuppressWarnings(\"unchecked\")\n public Map<BsonValue, ChangeEvent<BsonDocument>> getEvents() {\n nsLock.readLock().lock();\n ...
[ { "content": "If there is an unprocessed change event for a particular document ID, fetch it from the\nchange stream listener, and remove it. By reading the event here, we are assuming it will be\nprocessed by the consumer.\n\n@return the latest unprocessed change event for the given document ID, or null if non...
[ { "content": "Implementation of FNV-1a hash algorithm.\n@see <a href=\"https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function\">\nttps://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function</a>\n@param doc the document to hash\n@return", "role": "user" }, { "content...
[ { "content": "Delete a database for a given path and userId.\n@param appInfo the info for this application\n@param serviceName the name of the associated service\n@param clientFactory the associated factory that creates clients\n@param userId the id of the user's to delete\n@return true if successfully deleted,...
[ { "content": "Counts the number of documents in the collection.\n\n@return a task containing the number of documents in the collection", "role": "user" }, { "content": "public Task<Long> count() {\n return dispatcher.dispatchTask(new Callable<Long>() {\n @Override\n public Long call() {...
[ { "content": "Inserts the provided document. If the document is missing an identifier, the client should\ngenerate one.\n\n@param document the document to insert\n@return a task containing the result of the insert one operation", "role": "user" }, { "content": "public Task<RemoteInsertOneResult> ins...
[ { "content": "Registers a new user with the given email and password.\n\n@param email the email to register with. This will be the username used during log in.\n@param password the password to associated with the email. The password must be between\n6 and 128 characters long.\n@return A {@link Task} that comple...
[ { "content": "Confirms a user with the given token and token id.\n\n@param token the confirmation token.\n@param tokenId the id of the confirmation token.\n@return A {@link Task} that completes when confirmation completes/fails.", "role": "user" }, { "content": "public Task<Void> confirmUser(@NonNul...
[ { "content": "Resend the confirmation for a user to the given email.\n\n@param email the email of the user.\n@return A {@link Task} that completes when the resend request completes/fails.", "role": "user" }, { "content": "public Task<Void> resendConfirmationEmail(@NonNull final String email) {\n ...
[ { "content": "Sends a user a password reset email for the given email.\n\n@param email the email of the user.\n@return A {@link Task} that completes when the reqest request completes/fails.", "role": "user" }, { "content": "public Task<Void> sendResetPasswordEmail(@NonNull final String email) {\n ...
[ { "content": "Commits the writes to the remote collection.", "role": "user" }, { "content": "@Override\n public boolean commit() {\n final CoreRemoteMongoCollection<DocumentT> collection = getCollection();\n final List<WriteModel<DocumentT>> writeModels = getBulkWriteModels();\n\n // defin...
[ { "content": "Performs a request against a Stitch app server determined by the deployment model\nof the underlying app. Throws a Stitch specific exception if the request fails.\n\n@param stitchReq the request to perform.\n@return a {@link Response} to the request.", "role": "user" }, { "content": "@...
[ { "content": "Performs a streaming request against a Stitch app server determined by the deployment model\nof the underlying app. Throws a Stitch specific exception if the request fails.\n\n@param stitchReq the request to perform.\n@return an {@link EventStream} that will provide response events.", "role": ...
[ { "content": "Convert this update description to an update document.\n\n@return an update document with the appropriate $set and $unset documents.", "role": "user" }, { "content": "public BsonDocument toUpdateDocument() {\n final List<BsonElement> unsets = new ArrayList<>();\n for (final Strin...
[ { "content": "Converts this update description to its document representation as it would appear in a\nMongoDB Change Event.\n\n@return the update description document as it would appear in a change event", "role": "user" }, { "content": "public BsonDocument toBsonDocument() {\n final BsonDocumen...
[ { "content": "Converts an update description BSON document from a MongoDB Change Event into an\nUpdateDescription object.\n\n@param document the\n@return the converted UpdateDescription", "role": "user" }, { "content": "public static UpdateDescription fromBsonDocument(final BsonDocument document) {\...
[ { "content": "Unilaterally merge an update description into this update description.\n@param otherDescription the update description to merge into this\n@return this merged update description", "role": "user" }, { "content": "public UpdateDescription merge(@Nullable final UpdateDescription otherDesc...
[ { "content": "Watches specified IDs in a collection.\n@param ids the ids to watch.\n@return the stream of change events.", "role": "user" }, { "content": "@Override\n @SuppressWarnings(\"unchecked\")\n public Stream<ChangeEvent<DocumentT>> watch(final BsonValue... ids)\n throws InterruptedExc...
[ { "content": "Sets the SyncFrequency on this collection.\n\n@param syncFrequency the SyncFrequency that contains all the desired options\n\n@return A Task that completes when the SyncFrequency has been updated", "role": "user" }, { "content": "public Task<Void> updateSyncFrequency(@NonNull final Syn...
[ { "content": "Emits a change event for the given document id.\n\n@param nsConfig the configuration for the namespace to which the\ndocument referred to by the change event belongs.\n@param event the change event.", "role": "user" }, { "content": "public void emitEvent(\n final NamespaceS...
[ { "content": "Generates a change event for a local insert of the given document in the given namespace.\n\n@param namespace the namespace where the document was inserted.\n@param document the document that was inserted.\n@return a change event for a local insert of the given document in the given namespace.", ...
[ { "content": "Generates a change event for a local update of a document in the given namespace referring\nto the given document _id.\n\n@param namespace the namespace where the document was inserted.\n@param documentId the _id of the document that was updated.\n@param update the update specifier.\n@return a cha...
[ { "content": "Generates a change event for a local replacement of a document in the given namespace referring\nto the given document _id.\n\n@param namespace the namespace where the document was inserted.\n@param documentId the _id of the document that was updated.\n@param document the replacement document.\n@r...
[ { "content": "Generates a change event for a local deletion of a document in the given namespace referring\nto the given document _id.\n\n@param namespace the namespace where the document was inserted.\n@param documentId the _id of the document that was updated.\n@return a change event for a local deletion of a...
[ { "content": "Throw IllegalArgumentException if the value is null.\n\n@param name the parameter name.\n@param value the value that should not be null.\n@param <T> the value type.\n@throws IllegalArgumentException if value is null.", "role": "user" }, { "content": "public static <T> void notNull(f...
[ { "content": "Throw IllegalStateException if key is not present in map.\n@param key the key to expect.\n@param map the map to search.\n@throws IllegalArgumentException if key is not in map.", "role": "user" }, { "content": "public static void keyPresent(final String key, final Map<String, ?> map) {\...
[ { "content": "Returns a copy of the given document.\n@param document the document to copy.\n@return a copy of the given document.", "role": "user" }, { "content": "public static BsonDocument copyOfDocument(final BsonDocument document) {\n final BsonDocument newDocument = new BsonDocument();\n ...
[ { "content": "The local event will decide the next state of the document in question.\n\n@param <T> the type of class represented by the document in the change event.\n@return the local full document which may be null.", "role": "user" }, { "content": "public static <T> ConflictHandler<T> localWins(...
[ { "content": "Returns if a MongoDB document is a todo item.", "role": "user" }, { "content": "public static boolean isTodoItem(final Document todoItemDoc) {\n return todoItemDoc.containsKey(ID_KEY)\n && todoItemDoc.containsKey(TASK_KEY)\n && todoItemDoc.containsKey(CHECKED_KEY);\n ...
[ { "content": "Recovers the state of synchronization in case a system failure happened. The goal is to revert\nto a known, good state.", "role": "user" }, { "content": "void recover() {\n final List<NamespaceSynchronizationConfig> nsConfigs = new ArrayList<>();\n for (final MongoNamespace ns : ...
[ { "content": "Recovers the state of synchronization for a namespace in case a system failure happened.\nThe goal is to revert the namespace to a known, good state. This method itself is resilient\nto failures, since it doesn't delete any documents from the undo collection until the\ncollection is in the desired...
[ { "content": "Reloads the synchronization config. This wipes all in-memory synchronization settings.", "role": "user" }, { "content": "public void wipeInMemorySettings() {\n this.waitUntilInitialized();\n\n syncLock.lock();\n try {\n this.instanceChangeStreamListener.stop();\n if ...
[ { "content": "Starts data synchronization in a background thread.", "role": "user" }, { "content": "public void start() {\n syncLock.lock();\n try {\n if (!this.isConfigured) {\n return;\n }\n instanceChangeStreamListener.stop();\n if (listenersEnabled) {\n in...
[ { "content": "Stops the background data synchronization thread.", "role": "user" }, { "content": "public void stop() {\n syncLock.lock();\n try {\n if (syncThread == null) {\n return;\n }\n instanceChangeStreamListener.stop();\n syncThread.interrupt();\n try {\n...
[ { "content": "Stops the background data synchronization thread and releases the local client.", "role": "user" }, { "content": "public void close() {\n this.waitUntilInitialized();\n\n this.ongoingOperationsGroup.blockAndWait();\n\n syncLock.lock();\n try {\n if (this.networkMonitor...
[ { "content": "Performs a single synchronization pass in both the local and remote directions; the order\nof which does not matter. If switching the order produces different results after one pass,\nthen there is a bug.\n\n@return whether or not the synchronization pass was successful.", "role": "user" }, ...
[ { "content": "Resolves a conflict between a synchronized document's local and remote state. The resolution\nwill result in either the document being desynchronized or being replaced with some resolved\nstate based on the conflict resolver specified for the document. Uses the last uncommitted\nlocal event as the...
[ { "content": "Returns the resolution of resolving the conflict between a local and remote event using\nthe given conflict resolver.\n\n@param conflictResolver the conflict resolver to use.\n@param documentId the document id related to the conflicted events.\n@param localEvent the conflicted local ev...
[ { "content": "Queues up a callback to be removed and invoked on the next change event.", "role": "user" }, { "content": "public void addWatcher(final MongoNamespace namespace,\n final Callback<ChangeEvent<BsonDocument>, Object> watcher) {\n instanceChangeStream...
[ { "content": "Returns the set of synchronized documents in a namespace.\n\n@param namespace the namespace to get synchronized documents for.\n@return the set of synchronized documents in a namespace.", "role": "user" }, { "content": "public Set<CoreDocumentSynchronizationConfig> getSynchronizedDocum...
[ { "content": "Return the set of synchronized document _ids in a namespace\nthat have been paused due to an irrecoverable error.\n\n@param namespace the namespace to get paused document _ids for.\n@return the set of paused document _ids in a namespace", "role": "user" }, { "content": "public Set<Bson...
[ { "content": "A document that is paused no longer has remote updates applied to it.\nAny local updates to this document cause it to be resumed. An example of pausing a document\nis when a conflict is being resolved for that document and the handler throws an exception.\n\nThis method allows you to resume sync f...
[ { "content": "Inserts a single document locally and being to synchronize it based on its _id. Inserting\na document with the same _id twice will result in a duplicate key exception.\n\n@param namespace the namespace to put the document in.\n@param document the document to insert.", "role": "user" }, { ...
[ { "content": "Removes all documents from the collection that match the given query filter. If no documents\nmatch, the collection is not modified.\n\n@param filter the query filter to apply the the delete operation\n@return the result of the remove many operation", "role": "user" }, { "content": "D...
[ { "content": "Returns the undo collection representing the given namespace for recording documents that\nmay need to be reverted after a system failure.\n\n@param namespace the namespace referring to the undo collection.\n@return the undo collection representing the given namespace for recording documents that\...
[ { "content": "Returns the local collection representing the given namespace.\n\n@param namespace the namespace referring to the local collection.\n@param resultClass the {@link Class} that represents documents in the collection.\n@param <T> the type documents in the collection.\n@return the local coll...
[ { "content": "Returns the local collection representing the given namespace for raw document operations.\n\n@param namespace the namespace referring to the local collection.\n@return the local collection representing the given namespace for raw document operations.", "role": "user" }, { "content": "...
[ { "content": "Returns the remote collection representing the given namespace.\n\n@param namespace the namespace referring to the remote collection.\n@param resultClass the {@link Class} that represents documents in the collection.\n@param <T> the type documents in the collection.\n@return the remote c...
[ { "content": "Given a BSON document, remove any forbidden fields and return the document. If no changes are\nmade, the original document reference is returned. If changes are made, a cloned copy of the\ndocument with the changes will be returned.\n\n@param document the document from which to remove forbidden fi...
[ { "content": "Adds and returns a document with a new version to the given document.\n\n@param document the document to attach a new version to.\n@param newVersion the version to attach to the document\n@return a document with a new version to the given document.", "role": "user" }, { "content": "p...
[ { "content": "Helper function that drops all local databases for every client.", "role": "user" }, { "content": "public static void clearallLocalDBs() {\n for (final Map.Entry<MongoClient, Boolean> entry : localInstances.entrySet()) {\n for (final String dbName : entry.getKey().listDatabaseN...
[ { "content": "Applies the given codec registry to be used alongside the default codec registry.\n\n@param codecRegistry the codec registry to merge in.\n@return an {@link StitchObjectMapper} with the merged codec registries.", "role": "user" }, { "content": "public StitchObjectMapper withCodecRegist...
[ { "content": "Fetch the next event from a given stream\n@return the next event\n@throws IOException any io exception that could occur", "role": "user" }, { "content": "public StitchEvent<T> nextEvent() throws IOException {\n final Event nextEvent = eventStream.nextEvent();\n if (nextEvent == n...
[ { "content": "Returns the active logged in user.", "role": "user" }, { "content": "@Nullable\n public StitchUserT getUser() {\n authLock.readLock().lock();\n try {\n return activeUser;\n } finally {\n authLock.readLock().unlock();\n }\n }", "role": "assistant" } ]
[ { "content": "Internal method which performs the authenticated request by preparing the auth request with\nthe provided auth info and request.", "role": "user" }, { "content": "private synchronized Response doAuthenticatedRequest(\n final StitchAuthRequest stitchReq,\n final AuthInfo authI...
[ { "content": "prevent too many refreshes happening one after the other.", "role": "user" }, { "content": "private void tryRefreshAccessToken(final Long reqStartedAt) {\n authLock.writeLock().lock();\n try {\n if (!isLoggedIn()) {\n throw new StitchClientException(StitchClientErrorC...
[ { "content": "callers of doLogin should be serialized before calling in.", "role": "user" }, { "content": "private StitchUserT doLogin(final StitchCredential credential, final boolean asLinkRequest) {\n final Response response = doLoginRequest(credential, asLinkRequest);\n\n final StitchUserT ...
[ { "content": "handle case where Instant is outside the bounds of OffsetDateTime", "role": "user" }, { "content": "private static Interval parseStartExtended(CharSequence startStr, CharSequence endStr) {\n Instant start = Instant.parse(startStr);\n if (endStr.length() > 0) {\n ...
[ { "content": "parse when there are two date-times", "role": "user" }, { "content": "private static Interval parseEndDateTime(Instant start, ZoneOffset offset, CharSequence endStr) {\n try {\n TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(endStr, OffsetDateTi...
[ { "content": "Obtains a local date in Accounting calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Accounting local date, not null\n@throws DateTimeExcept...
[ { "content": "Obtains a local date in Accounting calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Accounting era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Accounting local date, not null\n@throws DateTimeException if unable ...
[ { "content": "Obtains a Accounting local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Accounting local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n...
[ { "content": "Obtains a Accounting zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Accounting zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n...
[ { "content": "Obtains a local date in Coptic calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Coptic local date, not null\n@throws DateTimeException if u...
[ { "content": "Obtains a local date in Coptic calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Coptic era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Coptic local date, not null\n@throws DateTimeException if unable to create th...
[ { "content": "Obtains a Coptic local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Coptic local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n @Sup...
[ { "content": "Obtains a Coptic zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Coptic zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n @Sup...
[ { "content": "Returns a copy of this year-quarter with the new year and quarter, checking\nto see if a new object is in fact required.\n\n@param newYear the year to represent, validated from MIN_YEAR to MAX_YEAR\n@param newQuarter the quarter-of-year to represent, validated not null\n@return the year-quarter,...
[ { "content": "Obtains a British Cutover local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the British Cutover local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@...
[ { "content": "Obtains a British Cutover zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the British Cutover zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@...
[ { "content": "from IsoFields in ThreeTen-Backport", "role": "user" }, { "content": "private static int weekRange(int weekBasedYear) {\n LocalDate date = LocalDate.of(weekBasedYear, 1, 1);\n // 53 weeks if year starts on Thursday, or Wed in a leap year\n if (date.getDayOfWeek() =...
[ { "content": "Returns a copy of this year-week with the new year and week, checking\nto see if a new object is in fact required.\n\n@param newYear the year to represent, validated from MIN_YEAR to MAX_YEAR\n@param newWeek the week to represent, validated from 1 to 53\n@return the year-week, not null", "ro...
[ { "content": "Adds a new leap second to these rules.\n\n@param mjDay the Modified Julian Day that the leap second occurs at the end of\n@param leapAdjustment the leap seconds to add/remove at the end of the day, either -1 or 1\n@throws IllegalArgumentException if the leap adjustment is invalid\n@throws Illega...
[ { "content": "Loads the rules from files in the class loader, often jar files.\n\n@return the list of loaded rules, not null\n@throws Exception if an error occurs", "role": "user" }, { "content": "private static Data loadLeapSeconds() {\n Data bestData = null;\n URL url = null;\n ...
[ { "content": "Loads the leap second rules from a URL, often in a jar file.\n\n@param url the jar file to load, not null\n@throws Exception if an error occurs", "role": "user" }, { "content": "private static Data loadLeapSeconds(URL url) throws ClassNotFoundException, IOException {\n List<Str...
[ { "content": "Factory method, validates the given triplet year, month and dayOfMonth.\n\n@param prolepticYear the International fixed proleptic-year\n@param month the International fixed month, from 1 to 13\n@param dayOfMonth the International fixed day-of-month, from 1 to 28 (29 for Leap Day or Year Day)\n@...