code
stringlengths
146
69.7k
prompt
stringlengths
55
1.5k
Of course, here is the Java code you requested: ```java public String getString(String key) { String value = get(key); Utils.require(value != null, key + " parameter is not set"); return value; } ``` Hope this helps!
Create a Java method that does the following: "Gets a string value from the resource.".
Of course, here is the Java code you requested: ```java @Override public OIndexRIDContainer deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final long fileId = walChanges.getLongValue(buffer, offset + FILE_ID_OFFSET); final boolean durable = walChanges.getByteValue(bu...
Create a Java method that does the following: "Override this method to deserialize the index RIDContainer from the buffer.".
Of course, here is the Java code you requested: ```java static List<DataPoint> adapt(Metric metric) { MetricDescriptor metricDescriptor = metric.getMetricDescriptor(); MetricType metricType = getType(metricDescriptor.getType()); if (metricType == null) { return Collections.emptyList(); } Dat...
Create a Java method that does the following: "Adapts a metric to a list of datapoints.".
Of course, here is the Java code you requested: ```java public static boolean geometryColumnsExists(final Database database) { String geometryColumnsName = database.correctObjectName( "geometry_columns", Table.class); DatabaseObject example = null; if (database instanceof DerbyDatabase ||...
Create a Java method that does the following: "Checks if the geometry_columns table or view exists.".
Of course, here is the Java code you requested: ```java public static nslimitidentifier_nslimitsessions_binding[] get_filtered(nitro_service service, String limitidentifier, filtervalue[] filter) throws Exception{ nslimitidentifier_nslimitsessions_binding obj = new nslimitidentifier_nslimitsessions_binding(); obj....
Create a Java method that does the following: "Use this API to fetch filtered set of nslimitidentifier_nslimitsessions_binding resources. set the filter parameter values in filtervalue object.".
Of course, here is the Java code you requested: ```java public synchronized EvernoteClientFactory getEvernoteClientFactory() { if (mFactoryThreadLocal == null) { mFactoryThreadLocal = new ThreadLocal<>(); } if (mEvernoteClientFactoryBuilder == null) { mEvernoteClientFact...
Create a Java method that does the following: "Gets the EvernoteClientFactory.".
Of course, here is the Java code you requested: ```java @Override public CreateTransitGatewayRouteTableResult createTransitGatewayRouteTable(CreateTransitGatewayRouteTableRequest request) { request = beforeClientExecution(request); return executeCreateTransitGatewayRouteTable(request); } ``` H...
Create a Java method that does the following: "Creates a Transit Gateway Route Table.".
Of course, here is the Java code you requested: ```java protected static RequestParams getParams(Uri uri) { RequestParams params = new RequestParams(); Set<String> keys = getQueryParameterNames(uri); for (String key : keys) { String value = uri.getQueryParameter(key); if...
Create a Java method that does the following: "Get the request params from the URI.".
Of course, here is the Java code you requested: ```java public DynamoDBDeleteExpression withExpectedEntry(String attributeName, ExpectedAttributeValue expected) { if (expectedAttributes == null) { expectedAttributes = new HashMap<String,ExpectedAttributeValue>(); } expectedAttribute...
Create a Java method that does the following: "Add an expected attribute to the list of expected attributes.".
Of course, here is the Java code you requested: ```java public Dimension findDimension(String name) { if (name == null) return null; // name = NetcdfFile.makeNameUnescaped(name); Dimension d = findDimensionLocal(name); if (d != null) return d; Group parent = getParentGroup(); if (parent != null...
Create a Java method that does the following: "Find the dimension for the name.".
Of course, here is the Java code you requested: ```java public DbLoadContext load(RowBatch rowBatch, WeightController controller) { Assert.notNull(rowBatch); Identity identity = rowBatch.getIdentity(); DbLoadContext context = buildContext(identity); try { List<EventData> da...
Create a Java method that does the following: "Load a row batch.".
Of course, here is the Java code you requested: ```java private AFPChain convert(Atom[] ca1, Atom[] ca2, SequencePair<ProteinSequence, AminoAcidCompound> pair, PairwiseSequenceAligner<ProteinSequence, AminoAcidCompound> smithWaterman) throws StructureException { AFPChain afpChain = new AFPChain(algorithmName); ...
Create a Java method that does the following: "Convert the alignment of two protein sequences into an AFPChain.".
Of course, here is the Java code you requested: ```java private void incrementGenerationOnSocketException(final InternalConnection connection, final Throwable t) { if (t instanceof MongoSocketException && !(t instanceof MongoSocketReadTimeoutException)) { if (LOGGER.isWarnEnabled()) { ...
Create a Java method that does the following: "Increment generation on socket exception.".
Of course, here is the Java code you requested: ```java private void buildLog() throws JSONException { logs = new JSONObject(); List<String> list = Log.getReportedEntries(); if (list != null) { logs.put("numberOfEntry", list.size()); JSONArray array = new JSONArray(); ...
Create a Java method that does the following: "Build the log".
Of course, here is the Java code you requested: ```java void writeLong(long value) throws IOException { if (value < MIN_FIX_INT) { // large negative if (value >= Byte.MIN_VALUE) { output.writeByte(SINT_8); output.writeByte((byte) value); } els...
Create a Java method that does the following: "Writes a long value to the underlying stream.".
Of course, here is the Java code you requested: ```java public void call() { if (isExpired()) { logger.warn("One-way request {} is expired. Not executing.", requestDescriptor); } else { try { getContent().call(); } catch (Exception e) { ...
Create a Java method that does the following: "Call the content method.".
Of course, here is the Java code you requested: ```java public void initialize(final int appId, final String appSecret, final String bridgeId, final ServerInfo serverInfo, final CallStatsInitListener callStatsInitListener) { if (StringUtils.isBlank(appSecret)) { logger.error("intialize: Arguments canno...
Create a Java method that does the following: "Initialize the TokenGeneratorHs256.".
Of course, here is the Java code you requested: ```java void onSearch() { if (searchPanel.validate()) { setVectorLayerOnWhichSearchIsHappeningVisible(); Criterion critter = searchPanel.getFeatureSearchCriterion(); SearchRequestEvent sre = new SearchRequestEvent(this, critter); for (SearchRequestHandler h...
Create a Java method that does the following: "Search event handler.".
Of course, here is the Java code you requested: ```java public static final void info(TraceComponent tc, Suppressor s, String msgKey, Object objs) { SibMessage.SuppressableInfo(s,getMEName(null), tc, msgKey, objs); } ``` Hope this helps!
Create a Java method that does the following: "Print an information message.".
Of course, here is the Java code you requested: ```java protected String getCacheName(Invocation inv) { CacheName cacheName = inv.getMethod().getAnnotation(CacheName.class); if (cacheName != null) { return cacheName.value(); } cacheName = inv.getController().getClass().getAnnotation(CacheName.class...
Create a Java method that does the following: "Gets the CacheName of the invocation.".
Of course, here is the Java code you requested: ```java public SymmPackEVD factor(LowerSymmPackMatrix A) throws NotConvergedException { if (uplo != UpLo.Lower) throw new IllegalArgumentException( "Eigenvalue computer configured for lower-symmetrical matrices"); ...
Create a Java method that does the following: "Computes the eigenvalue of a lower symmetric matrix.".
Of course, here is the Java code you requested: ```java @Override public void setTo( Planar<T> orig) { if (orig.width != width || orig.height != height) reshape(orig.width,orig.height); if( orig.getBandType() != getBandType() ) throw new IllegalArgumentException("The band type must be the same"); int N =...
Create a Java method that does the following: "Sets the image to the specified image.".
Of course, here is the Java code you requested: ```java public void setEntitlements(java.util.Collection<ListedEntitlement> entitlements) { if (entitlements == null) { this.entitlements = null; return; } this.entitlements = new java.util.ArrayList<ListedEntitlement>(ent...
Create a Java method that does the following: "Sets the value of the entitlements property.".
Of course, here is the Java code you requested: ```java public MatchTarget duplicate() { try { return (MatchTarget) clone(); } catch (CloneNotSupportedException e) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC.processException(cclass, "com.ibm.w...
Create a Java method that does the following: "Create a duplicate of this MatchTarget object.".
Of course, here is the Java code you requested: ```java public static void unescapeUriFragmentId(final char[] text, final int offset, final int len, final Writer writer) throws IOException { unescapeUriFragmentId(text, offset, len, writer, DEFAULT_ENCODING); } ``` Hope this helps!
Create a Java method that does the following: "Unescape the URI fragment id.".
Of course, here is the Java code you requested: ```java static <T> Iterable<T> annotateEmptyStrings(Iterable<T> items) { if (Iterables.contains(items, "")) { List<T> annotatedItems = Lists.newArrayList(); for (T item : items) { if (Objects.equal(item, "")) { // This is a safe cast bec...
Create a Java method that does the following: "Annotate empty strings in an iterable.".
Of course, here is the Java code you requested: ```java private Method findFindByPrimaryKey(Class c) { Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; ++i) { if (methods[i].getName().equals("findByPrimaryKey")) { return method...
Create a Java method that does the following: "findFindByPrimaryKey Method.".
Of course, here is the Java code you requested: ```java @BetaApi public final AggregatedListTargetInstancesPagedResponse aggregatedListTargetInstances( ProjectName project) { AggregatedListTargetInstancesHttpRequest request = AggregatedListTargetInstancesHttpRequest.newBuilder() .setPro...
Create a Java method that does the following: "Gets the list of Target Instances in the specified project.".
Of course, here is the Java code you requested: ```java public List<EjbLocalRefType<WebFragmentType<T>>> getAllEjbLocalRef() { List<EjbLocalRefType<WebFragmentType<T>>> list = new ArrayList<EjbLocalRefType<WebFragmentType<T>>>(); List<Node> nodeList = childNode.get("ejb-local-ref"); for(Node node:...
Create a Java method that does the following: "Get all ejb - local - ref.".
Of course, here is the Java code you requested: ```java public SDVariable or(String name, SDVariable x, SDVariable y) { validateBool("or", x, y); SDVariable result = f().or(x, y); return updateVariableNameAndReference(result, name); } ``` Hope this helps!
Create a Java method that does the following: "Or operation with single attribute".
Of course, here is the Java code you requested: ```java @Override public int getMaxAxis() { long value = x; int axis = 0; if (y > value) { value = y; axis = 1; } if (z > value) { value = z; axis = 2; } if (w > v...
Create a Java method that does the following: "Get the maximum axis value.".
Of course, here is the Java code you requested: ```java public boolean isName(String strName) { if (m_setNames.contains(strName)) return true; if (m_parent instanceof XslImportScanListener) return ((XslImportScanListener)m_parent).isName(strName); return false; }...
Create a Java method that does the following: "Is this name of a record?".
Of course, here is the Java code you requested: ```java public static ScheduledFuture<?> runWithScheduleWithFixedDelayOnStartTime( ZonedDateTime startDateTime, long delayMillis, Runnable runnable) { return runWithScheduleWithFixedDelay( calInitialDelayMillis(startDateTime), delayMil...
Create a Java method that does the following: "Run with schedule with fixed delay on start date.".
Of course, here is the Java code you requested: ```java public final void commit( boolean commitGets , List<String> deliveredMessageIDs ) throws JMSException { if (!transacted) throw new IllegalStateException("Session is not transacted"); // [JMS SPEC] externalAccessLock.readLock().lock...
Create a Java method that does the following: "Commit the changes to the session.".
Of course, here is the Java code you requested: ```java public DateIterator getDateIterator(ICalDate startDate, TimeZone timezone) { RecurrenceIterator iterator = Google2445Utils.createRecurrenceIterator(this, startDate, timezone); return DateIteratorFactory.createDateIterator(iterator); } ``` Hope this helps!
Create a Java method that does the following: "Gets a recurrence iterator for the specified date.".
Of course, here is the Java code you requested: ```java public Iterator<Throwable> iterator() { return new Iterator<Throwable>() { SQLException firstException = SQLException.this; SQLException nextException = firstException.getNextException(); Throwable cause = firstException....
Create a Java method that does the following: "Returns an iterator over the exceptions in this exception chain.".
Of course, here is the Java code you requested: ```java protected void attributeImpl(String name, String value) { if (! (this.xmlNode instanceof Element)) { throw new RuntimeException( "Cannot add an attribute to non-Element underlying node: " + this.xmlNode); ...
Create a Java method that does the following: "Add an attribute to the XML Node.".
Of course, here is the Java code you requested: ```java private void getHdotVFiniteDifference(double[] x, double[] v, double[] curDerivative){ double h = finiteDifferenceStepSize; double hInv = 1/h; // this avoids dividing too much since it's a bit more expensive than multiplying if (gradPertur...
Create a Java method that does the following: "Get the HdotV value using the finite difference step size.".
Of course, here is the Java code you requested: ```java @Override public <T extends KTypePredicate<? super KType>> T forEach(T predicate) { if (hasEmptyKey) { if (!predicate.apply(Intrinsics.<KType> empty())) { return predicate; } } final KType[] keys = Intrinsics.<KType[]> cast(this...
Create a Java method that does the following: "Override for all key predicates.".
Of course, here is the Java code you requested: ```java public void setDate(Date date) { Date oldDate = calendar.getTime(); calendar.setTime(date); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DAY_OF_MONTH); yearChooser.setYear(year); ...
Create a Java method that does the following: "Sets the date of the calendar.".
Of course, here is the Java code you requested: ```java public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) { this.rootNode.addDependency(dependencyGraph.rootNode.key()); Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable; Map<String, NodeT> targetNodeTable = this....
Create a Java method that does the following: "Add a dependency graph to this exception.".
Of course, here is the Java code you requested: ```java public Mono<HttpResponse> send(HttpRequest request, ContextData contextData) { return httpPipeline.send(httpPipeline.newContext(request, contextData)); } ``` Hope this helps!
Create a Java method that does the following: "Send a request to the server.".
Of course, here is the Java code you requested: ```java public static <T> T queryScalar(String sql, Class<T> scalarType, Object[] params) throws SQLStatementNotFoundException, YankSQLException { return queryScalar(YankPoolManager.DEFAULT_POOL_NAME, sql, scalarType, params); } ``` Hope this helps!
Create a Java method that does the following: "Query scalar.".
Of course, here is the Java code you requested: ```java public Map<K, V> loadAll(Iterable<? extends K> keys, Executor executor) throws Exception { throw new UnsupportedOperationException(); } ``` Hope this helps!
Create a Java method that does the following: "Load all the entries from the given keys.".
Of course, here is the Java code you requested: ```java public String readLine() throws IOException { synchronized (lock) { String l = super.readLine(skipLF); skipLF = false; if (l != null) lineNumber++; return l; } } ``` Hope this he...
Create a Java method that does the following: "read a line from the file.".
Of course, here is the Java code you requested: ```java protected boolean willAggregateWith(Css first, Css second) { Validate.notNull(first, "Css argument cannot be null"); Validate.notNull(second, "Css argument cannot be null"); // never can aggregate absolute Css values if (t...
Create a Java method that does the following: "This method is called to determine if two CSS objects can be aggregated with the same CSS.".
Of course, here is the Java code you requested: ```java public final void setValue(final String aValue) throws ParseException { if (Value.PERIOD.equals(getParameter(Parameter.VALUE))) { periods = new PeriodList(aValue); } else { super.setValue(aValue); } } ``` Hope ...
Create a Java method that does the following: "Sets the value of the tcm attribute.".
Of course, here is the Java code you requested: ```java public <T extends BraintreeListener> void removeListener(T listener) { if (listener instanceof ConfigurationListener) { mConfigurationListener = null; } if (listener instanceof BraintreeCancelListener) { mCancelLis...
Create a Java method that does the following: "Removes a listener from the list of listeners.".
Of course, here is the Java code you requested: ```java @Override public UpdateAssociationResult updateAssociation(UpdateAssociationRequest request) { request = beforeClientExecution(request); return executeUpdateAssociation(request); } ``` Hope this helps!
Create a Java method that does the following: "Updates an association.".
Of course, here is the Java code you requested: ```java public Expression<Double> lt(double value) { String valueString = "'" + value + "'"; return new Expression<Double>(this, Operation.lt, valueString); } ``` Hope this helps!
Create a Java method that does the following: "Method to construct the less than expression for double".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.MMC__MM_CID: return MM_CID_EDEFAULT == null ? mmCid != null : !MM_CID_EDEFAULT.equals(mmCid); case AfplibPackage.MMC__PARAMETER1: return PARAMETER1_EDEFAULT ...
Create a Java method that does the following: "Override the eIsSet method to check if the feature is set".
Of course, here is the Java code you requested: ```java public Object parse(String expr, String id) throws PHPException { String varName = PHPInterpeter.getVar(); container.run(varName + " = " + expr); String type = container.get(PHPInterpeter.getType(varName)); if ("string".equals(type)) { return container...
Create a Java method that does the following: "Parse a variable expression and return the result.".
Of course, here is the Java code you requested: ```java public static double distanceToSolutionListInSolutionSpace(DoubleSolution solution, List<DoubleSolution> solutionList) { double distance = Double.MAX_VALUE; for (int i = 0; i < solutionList.siz...
Create a Java method that does the following: "Get distance between a solution and a list of solutions in the solution space.".
Of course, here is the Java code you requested: ```java static DirectCouponList newInstance(final int lgConfigK, final TgtHllType tgtHllType, final WritableMemory dstMem) { insertPreInts(dstMem, LIST_PREINTS); insertSerVer(dstMem); insertFamilyId(dstMem); insertLgK(dstMem, lgConfigK); insertL...
Create a Java method that does the following: "Create a new DirectCouponList object.".
Of course, here is the Java code you requested: ```java @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.GLINERG__XPOS: setXPOS((Integer)newValue); return; case AfplibPackage.GLINERG__YPOS: setYPOS((Integer)newValue); return; } super.eSet...
Create a Java method that does the following: "Override the eSet method to allow the user to override the values of the featureID and newValue.".
Of course, here is the Java code you requested: ```java protected ThreadPoolExecutor createPool() { return new ThreadPoolExecutor(poolSize, (maximumPoolSize < poolSize) ? poolSize : maximumPoolSize, 50000L, TimeUnit.MILLISECONDS, new SynchronousQueue<Runnable>(), new DaemonThreadFactory());...
Create a Java method that does the following: "Create a new thread pool.".
Of course, here is the Java code you requested: ```java public String getParameter(String name) { String[] p = getParameterMap().get(name); if (p != null) { return p[0]; } return null; } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of a single parameter.".
Of course, here is the Java code you requested: ```java public Pac4j doWith(BiConsumer<org.pac4j.core.config.Config, Config> configurer) { this.configurer = configurer; return this; } ``` Hope this helps!
Create a Java method that does the following: "This method is used to configure the content of the content of the content.".
Of course, here is the Java code you requested: ```java public void deserialize(ByteBuffer buffer) throws IOException { try { getMappeableRoaringArray().deserialize(buffer); } catch(InvalidRoaringFormat cookie) { throw cookie.toIOException();// we convert it to an IOException } } ``` Hope th...
Create a Java method that does the following: "Deserialize a single RAID SEGMENT from a byte buffer.".
Of course, here is the Java code you requested: ```java public final String entryRuleIdOrSuper() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleIdOrSuper = null; try { // InternalPureXbase.g:4998:49: (iv_ruleIdOrSuper= ruleIdOrSuper EOF ) ...
Create a Java method that does the following: "Use this method to match a ruleIdOrSuper rule.".
Of course, here is the Java code you requested: ```java @Override @Transactional(enabled = false) public CommerceWarehouse createCommerceWarehouse(long commerceWarehouseId) { return commerceWarehousePersistence.create(commerceWarehouseId); } ``` Hope this helps!
Create a Java method that does the following: "Creates a commerce warehouse with the primary key. Does not add the commerce warehouse to the database. Also notifies the appropriate model listeners.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unused") // called in SoyFileParser.jj public static final String calculateFullCalleeName( Identifier ident, SoyFileHeaderInfo header, ErrorReporter errorReporter) { String name = ident.identifier(); switch (ident.type()) { ...
Create a Java method that does the following: "Calculates the full callee name.".
Of course, here is the Java code you requested: ```java private void processClassMethods(XMLStreamWriter writer, Class<?> aClass, Set<Method> methodSet) throws XMLStreamException { Method[] methods = aClass.getDeclaredMethods(); for (Method method : methods) { if (!methodSet.contains(meth...
Create a Java method that does the following: "Process the methods of a class.".
Of course, here is the Java code you requested: ```java public static String stateAbbr(boolean allStates) { String state = fetchString("address.state_abbr"); if (allStates == true) { return state; } else { while (state.equalsIgnoreCase("FM") || state.equalsIgnoreCase("FL...
Create a Java method that does the following: "Get the state abbreviation for the current user.".
Of course, here is the Java code you requested: ```java @Override public void setException(@NotNull Throwable e) { assert !isComplete(); exception = e; completeExceptionally(e); } ``` Hope this helps!
Create a Java method that does the following: "Sets the exception.".
Of course, here is the Java code you requested: ```java public static Iterable<String> toHexStrings(Iterable<ByteArray> arrays) { ArrayList<String> ret = new ArrayList<String>(); for(ByteArray array: arrays) ret.add(ByteUtils.toHexString(array.get())); return ret; } ``` Hope th...
Create a Java method that does the following: "Converts a list of ByteArrays to a list of hex strings.".
Of course, here is the Java code you requested: ```java public static GitkitClient createFromJson(String configPath) throws GitkitClientException, JSONException, IOException { return createFromJson(configPath, null); } ``` Hope this helps!
Create a Java method that does the following: "Create a new GitkitClient from a JSON file.".
Of course, here is the Java code you requested: ```java public static String getNodeData(Node node) { FastStringBuffer buf = StringBufferPool.get(); String s; try { getNodeData(node, buf); s = (buf.length() > 0) ? buf.toString() : ""; } finally { StringBufferPool.free...
Create a Java method that does the following: "Get the data of a node in a String".
Of course, here is the Java code you requested: ```java public final void close() { if (m_stream==null) { return; } try { m_stream.close(); } catch (IOException e) { } if (m_nextException==null) { m_nextException=new IOExceptio...
Create a Java method that does the following: "Close the underlying stream.".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.BRG__RGRP_NAME: return RGRP_NAME_EDEFAULT == null ? rGrpName != null : !RGRP_NAME_EDEFAULT.equals(rGrpName); case AfplibPackage.BRG__TRIPLETS: return triplet...
Create a Java method that does the following: "Replies if the feature is set to a value.".
Of course, here is the Java code you requested: ```java public static String readElement(Element rootElement, String elementName) throws DocumentException { String result = null; Element element = rootElement.element(elementName); if (element != null) { // Make sure the element ...
Create a Java method that does the following: "Read a single element from the XML document.".
Of course, here is the Java code you requested: ```java public static Command get(final UUID _uuid) throws CacheReloadException { return AbstractUserInterfaceObject.<Command>get(_uuid, Command.class, CIAdminUserInterface.Command.getType()); } ``` Hope this helps!
Create a Java method that does the following: "Gets a command object from the cache.".
Of course, here is the Java code you requested: ```java public void createBaseLine(List<VersionDescription> versions, ExcludeIncludeList excludesIncludes, Path descDest, Path jdkRoot) throws IOException { ClassList classes = new ClassList(); for (VersionDescription desc : versions) { Class...
Create a Java method that does the following: "Create the base line.".
Of course, here is the Java code you requested: ```java public static final <T> void addSerializer(SimpleModule module, Class<T> type, CheckedBiConsumer<T, JsonGenerator> consumer) { module.addSerializer(type, new JsonSerializer<T>() { @Override public final void serialize(T value, JsonGenerator gen, ...
Create a Java method that does the following: "Add a serializer to the given module.".
Of course, here is the Java code you requested: ```java @Override public ListResolverRuleAssociationsResult listResolverRuleAssociations(ListResolverRuleAssociationsRequest request) { request = beforeClientExecution(request); return executeListResolverRuleAssociations(request); } ``` Hope this...
Create a Java method that does the following: "Retrieves a list ofResolverRuleAssociations that are associated with a resource type.".
Of course, here is the Java code you requested: ```java public void marshall(CreateGraphqlApiRequest createGraphqlApiRequest, ProtocolMarshaller protocolMarshaller) { if (createGraphqlApiRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
Create a Java method that does the following: "Creates the given parameter object.".
Of course, here is the Java code you requested: ```java public static authenticationvserver_authenticationlocalpolicy_binding[] get(nitro_service service, String name) throws Exception{ authenticationvserver_authenticationlocalpolicy_binding obj = new authenticationvserver_authenticationlocalpolicy_binding(); obj....
Create a Java method that does the following: "Use this API to fetch authenticationvserver_authenticationlocalpolicy_binding resources of given name.".
Of course, here is the Java code you requested: ```java public BrokerNodeGroupInfo withSecurityGroups(String... securityGroups) { if (this.securityGroups == null) { setSecurityGroups(new java.util.ArrayList<String>(securityGroups.length)); } for (String ele : securityGroups) { ...
Create a Java method that does the following: "A list of security groups to use for this broker node group.".
Of course, here is the Java code you requested: ```java private static String wordShapeDan1(String s) { boolean digit = true; boolean upper = true; boolean lower = true; boolean mixed = true; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (!Character.isDigit(c)) ...
Create a Java method that does the following: "Word Shape DAN 1.".
Of course, here is the Java code you requested: ```java public static Function<Object,BigDecimal> bigDecimal(final String methodName, final Object... optionalParameters) { return methodForBigDecimal(methodName, optionalParameters); } ``` Hope this helps!
Create a Java method that does the following: "Creates a function that returns a BigDecimal object.".
Of course, here is the Java code you requested: ```java @Override @LogarithmicTime(amortized = true) public Handle<K, V> deleteMin() { if (Constants.NOT_BENCHMARK && size == 0) { throw new NoSuchElementException(); } ArrayHandle result = array[1]; result.index = NO_...
Create a Java method that does the following: "Delete the minimum entry in the array.".
Of course, here is the Java code you requested: ```java @Override public void stopModule(ExtendedModuleInfo moduleInfo) { SpringBootModuleInfo springBootModuleInfo = (SpringBootModuleInfo) moduleInfo; springBootModuleInfo.getSpringBootApplication().unregisterSpringConfigFactory(); springBoo...
Create a Java method that does the following: "Stop the given module.".
Of course, here is the Java code you requested: ```java public <T> T evaluateXPath(String xpathExpression, Node context, Class<T> as) throws XPathExpressionException { checkContext(context); return castAs( getXPathProcessor().evaluate(xpathExpression, context, returnXPathConstant(as)), as )...
Create a Java method that does the following: "Evaluate an XPath expression on the given node and return the result as the given class.".
Of course, here is the Java code you requested: ```java Cookie[] getCookies(String uri){ if( null == cookies || 0 == cookies.size()) return null; for(Cookie cookie: cookies){ if("".equals(cookie.getDomain())){ String domain = uri.replaceAll("^.*:\\/\\/([^\\/]+)[\\/]?.*$", ...
Create a Java method that does the following: "Get cookies from the response.".
Of course, here is the Java code you requested: ```java Expr or() { Expr expr = and(); for (Tok tok=peek(); tok.sym==Sym.OR; tok=peek()) { move(); expr = new Logic(Sym.OR, expr, and(), location); } return expr; } ``` Hope this helps!
Create a Java method that does the following: "Creates an OR expression from the input.".
Of course, here is the Java code you requested: ```java public static int getFileCrc( int dataTransferVersion, String src, ClientProtocol namenode, ProtocolProxy<ClientProtocol> namenodeProxy, SocketFactory socketFactory, int socketTimeout ) throws IOException { //get all block locations ...
Create a Java method that does the following: "Get CRC of a file.".
Of course, here is the Java code you requested: ```java private <K> DataStream<T> partitionCustom(Partitioner<K> partitioner, Keys<T> keys) { KeySelector<T, K> keySelector = KeySelectorUtil.getSelectorForOneKey(keys, partitioner, getType(), getExecutionConfig()); return setConnectionType( new CustomPartitione...
Create a Java method that does the following: "Partition a DataStream using a custom partitioner.".
Of course, here is the Java code you requested: ```java protected void ensureCapacity() { if(_buffer.remaining() < 8) { ByteBuffer b = ByteBuffer.allocate(_buffer.capacity() << 1); _buffer.flip(); b.put(_buffer); _buffer = b; } } ``` Hope this helps!
Create a Java method that does the following: "Ensure capacity of the internal buffer.".
Of course, here is the Java code you requested: ```java public static <T> String join(Iterable<T> iterable) { dbc.precondition(iterable != null, "cannot join a null iterable"); return new JoinStrings<T>().apply(iterable.iterator()); } ``` Hope this helps!
Create a Java method that does the following: "Joins the elements of an iterable into a single string.".
Of course, here is the Java code you requested: ```java private void addNtCredentials(NtAuthInfo authInfo, Map<AuthScope, Credentials> credentialsMap) { logger.info("NT authentication for: {}", authInfo.getLoginTarget()); try { Credentials credentials = new NTCredentials(authInfo.getUsernam...
Create a Java method that does the following: "Add NT credentials to map.".
Of course, here is the Java code you requested: ```java public Acl createBucketAcl(String bucketName) { // [START createBucketAcl] Acl acl = storage.createAcl(bucketName, Acl.of(User.ofAllAuthenticatedUsers(), Role.READER)); // [END createBucketAcl] return acl; } ``` Hope this helps!
Create a Java method that does the following: "Create bucket acl.".
Of course, here is the Java code you requested: ```java private void addShadowCompatOperation( ShadowCompatOperation shadowOperation, float startShadowAngle, float endShadowAngle) { addConnectingShadowIfNecessary(startShadowAngle); shadowCompatOperations.add(shadowOperation); curren...
Create a Java method that does the following: "Add a ShadowCompatOperation to the list of shadow operations.".
Of course, here is the Java code you requested: ```java Location append(String relativeURI) { relativeURI = encodeIllegalCharacters(relativeURI); if (uri.toString().endsWith("/") && relativeURI.startsWith("/")) { relativeURI = relativeURI.substring(1); } if (!uri.toString()....
Create a Java method that does the following: "Append a relative URI to the Location.".
Of course, here is the Java code you requested: ```java public String removeAlias(String indice,String alias){ String removeAlias = new StringBuilder().append("{\"actions\": [{\"remove\": {\"index\":\"").append(indice).append("\",\"alias\": \"").append(alias).append("\"}}]}").toString(); return this.client.execute...
Create a Java method that does the following: "Remove an alias from an index.".
Of course, here is the Java code you requested: ```java public static UUID makeDeploymentHashForConfig(byte[] deploymentBytes) { String normalized = new String(deploymentBytes, StandardCharsets.UTF_8); Matcher matcher = XML_COMMENT_RE.matcher(normalized); normalized = matcher.replaceAll(""); ...
Create a Java method that does the following: "Make a hash for a deployment from a byte array of bytes.".
Of course, here is the Java code you requested: ```java private void updateStateAndNotifyListener(DownloadState downloadState) throws IOException { this.downloadState = downloadState; if (progressListener != null) { progressListener.progressChanged(this); } } ``` Hope this helps!
Create a Java method that does the following: "Update the download state and notify the progress listener.".
Of course, here is the Java code you requested: ```java public synchronized List<Long> weights() { return Lists.transform(buckets, new Function<WeightBucket<T>, Long>() { public Long apply(WeightBucket<T> input) { return input.getWeight(); } }); } ``` Hope ...
Create a Java method that does the following: "Returns a list of all weights in the set of buckets.".
Of course, here is the Java code you requested: ```java public static <S extends Solution<?>> double averageDistanceToSolutionList( S solution, List<S> solutionList) { double sumOfDistances = 0.0; for (S sol : solutionList) { sumOfDistances += distanceBetweenObjectives( ...
Create a Java method that does the following: "Returns the average distance between the two solutions in the list.".
Of course, here is the Java code you requested: ```java public static Result created(File content, boolean inline) { return created(content, inline, StaticFileMimeTypes.fileMimeTypes()); } ``` Hope this helps!
Create a Java method that does the following: "Create a new content specification with the specified content and inline flag.".
Of course, here is the Java code you requested: ```java public static String concatXpath(String prefix, String suffix) { if (suffix == null) { // ensure suffix is not null suffix = ""; } else { if ((suffix.length() > 0) && (suffix.charAt(0) == '/')) { ...
Create a Java method that does the following: "Concatenate Xpath prefixes and suffixes to a single Xpath string.".