code
stringlengths
160
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public Channel setLogoDrawable(String id, String yourPackageName) { String endpoint = "android.resource://"+id+"/drawable/"; this.logoUrl = endpoint + id; return this; } ``` Hope this helps!
Create a Java method that does the following: "Set the logo drawable".
Of course, here is the Java code you requested: ```java public final T getComponent(final String aName) { for (final T c : this) { if (c.getName().equals(aName)) { return c; } } return null; } ``` Hope this helps!
Create a Java method that does the following: "Get the component with the specified name.".
Of course, here is the Java code you requested: ```java @Override public boolean previous() throws SQLException { checkClosed(); if (cursorPosition == Position.afterLast) { return last(); } if (cursorPosition == Position.beforeFirst || table.getActiveRowIndex() <= 0) { ...
Create a Java method that does the following: "Method previous.".
Of course, here is the Java code you requested: ```java public UserCustomResultSet query(BoundingBox boundingBox, Projection projection) { BoundingBox featureBoundingBox = projectBoundingBox(boundingBox, projection); return query(featureBoundingBox); } ``` Hope this helps!
Create a Java method that does the following: "Query for features in the bounding box using the projection".
Of course, here is the Java code you requested: ```java private String getCharacterConjunction(String text1, String text2, int windowLength) { StringBuilder conjunction = new StringBuilder(); StringBuilder target = new StringBuilder(text2); int len1 = text1.length(); for (int i = 0; i <...
Create a Java method that does the following: "getCharacterConjunction Method.".
Of course, here is the Java code you requested: ```java public void updateDigest(MessageDigest message, ByteBuffer context) { ByteBuffer dup = context.duplicate(); dup.position(context.position() + headerLength(context)); message.update(dup); } ``` Hope this helps!
Create a Java method that does the following: "Update the message digest with the given context.".
Of course, here is the Java code you requested: ```java public Mono<AccessLevel> getAccessLevel(String token, String applicationId) throws CloudFoundryAuthorizationException { String uri = getPermissionsUri(applicationId); return this.webClient.get().uri(uri).header("Authorization", "bearer " + token) .retr...
Create a Java method that does the following: "Get the access level for the given token.".
Of course, here is the Java code you requested: ```java public void saveToolbarVisibility(final boolean visible) { CmsRpcAction<Void> action = new CmsRpcAction<Void>() { /** * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute() */ @Override pub...
Create a Java method that does the following: "Saves the visibility of the toolbar.".
Of course, here is the Java code you requested: ```java private static final UByte[] mkValues() { UByte[] ret = new UByte[256]; for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) ret[i & MAX_VALUE] = new UByte((byte) i); return ret; } ``` Hope this helps!
Create a Java method that does the following: "This method creates the array of UByte values for the recordset.".
Of course, here is the Java code you requested: ```java private void writeValue(int curLen) { for (int i=0; i < curLen; i++) newData[newDataPos++] = data[dataPos++]; } ``` Hope this helps!
Create a Java method that does the following: "Write the value of the tca.".
Of course, here is the Java code you requested: ```java public static <T> T checkNotNull(T obj, String name) { if (obj == null) { String msg = String.format("parameter '%s' cannot be null", name); throw new NullPointerException(msg); } return obj; } ``` Hope this helps!
Create a Java method that does the following: "Check that the object is not null.".
Of course, here is the Java code you requested: ```java public Map<String, AnnotationDefinition> getDefinitionMap() { if (definitions == null) { return emptyMap(); } final Map<String, AnnotationDefinition> ret = new HashMap<String, AnnotationDefinition>(definitions.s...
Create a Java method that does the following: "Gets the definition map.".
Of course, here is the Java code you requested: ```java public Matrix3d zero() { m00 = 0.0; m01 = 0.0; m02 = 0.0; m10 = 0.0; m11 = 0.0; m12 = 0.0; m20 = 0.0; m21 = 0.0; m22 = 0.0; return this; } ``` Hope this helps!
Create a Java method that does the following: "Zero the matrix.".
Of course, here is the Java code you requested: ```java public static <T> Set<T> immutableSetView(Set<T> set) { if (set instanceof ImmutableSet<?>) { return set; } return Collections.unmodifiableSet(set); } ``` Hope this helps!
Create a Java method that does the following: "Returns an immutable view of the given set.".
Of course, here is the Java code you requested: ```java public List<E> getCondensedList() { return new AbstractList<E>() { @SuppressWarnings("unchecked") @Override public E get(int arg0) { stateLock.readLock().lock(); try { ...
Create a Java method that does the following: "Gets theCondensedList method.".
Of course, here is the Java code you requested: ```java @Scheduled(fixedRate = 60000) public void logStatistics() { // TODO: do we want to log diff with last log instead? if (LOG.isDebugEnabled()) { LOG.debug("Cache stats:"); for (Map.Entry<String, LoadingCache<Query<Entity>, List<Object>>> cache...
Create a Java method that does the following: "Log the cache statistics.".
Of course, here is the Java code you requested: ```java private static final <T extends Appendable> void encodeRun(T buffer, byte value, int length, byte[] state) { if (length < 4) { for (int j=0; j<length; ++j) { if (value == ESCAPE_BYTE) appendEncodedByte(buffer, ESCAP...
Create a Java method that does the following: "Encode a single run of a single entry.".
Of course, here is the Java code you requested: ```java boolean isUsingSecurityDefaults() { Jenkins j = Jenkins.get(); if (j.getSecurityRealm() instanceof HudsonPrivateSecurityRealm) { HudsonPrivateSecurityRealm securityRealm = (HudsonPrivateSecurityRealm)j.getSecurityRealm(); t...
Create a Java method that does the following: "Checks if the user and password are correct.".
Of course, here is the Java code you requested: ```java @Override public Object generate(Client<?> client, String dataType) { return UUID.randomUUID().toString(); } ``` Hope this helps!
Create a Java method that does the following: "Generate a random ID.".
Of course, here is the Java code you requested: ```java public static String formatThread(Thread thread) { assertInitialization(); return XLog.sLogConfiguration.threadFormatter.format(thread); } ``` Hope this helps!
Create a Java method that does the following: "Format a thread.".
Of course, here is the Java code you requested: ```java private String createQueryString() { QueryChunk[] chunks = query.getChunks(); if ((chunks == null) || (chunks.length == 0)) { // no query chunks return ""; } StringBuffer sb = new StringBuffer(); QueryChunk chunk = null; int p...
Create a Java method that does the following: "Create the query string".
Of course, here is the Java code you requested: ```java private void loadImage() { List<Transformation> transformations = getTransformations(); boolean hasUrl = url != null; boolean hasResourceId = resourceId != null; boolean hasPlaceholder = placeholderId != null; ListenerTarget listenerTarget = g...
Create a Java method that does the following: "Load an image from the image resource.".
Of course, here is the Java code you requested: ```java public final <E> E deserialize(String str, Class<E> type, Collection<Class<? extends Converter<?>>> converterClasses) { logger.debug("deserialize(\"{}\", {})", str, type); final DelegatingConverter delegatingConverter = new DelegatingConverter();...
Create a Java method that does the following: "Deserialize a string to a class.".
Of course, here is the Java code you requested: ```java protected static String[] parseMACs (String text) { if (text == null) { return new String[0]; } Matcher m = MACRegex.matcher(text); ArrayList<String> list = new ArrayList<String>(); while (m.find()) { ...
Create a Java method that does the following: "Parses the MAC addresses in the text.".
Of course, here is the Java code you requested: ```java @Override public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { return createReceiver(queue); } ``` Hope this helps!
Create a Java method that does the following: "Override this method to create a QueueReceiver.".
Of course, here is the Java code you requested: ```java private double[] calculateDirectionFactor( double dx, double dy ) { // direction factor, where the components are 1/length double[] fact = new double[9]; for( int k = 1; k <= 8; k++ ) { fact[k] = 1.0 / (Math.sqrt(DIR_WITHFLOW_E...
Create a Java method that does the following: "Calculate the direction factor for the given dx and dy".
Of course, here is the Java code you requested: ```java private Set<Node> checkNegationSpecifier(NegationSpecifier specifier) throws NodeSelectorException { List<Selector> parts = new ArrayList<Selector>(1); parts.add(specifier.getSelector()); return check(parts); } ``` Hope this helps...
Create a Java method that does the following: "Check a negation specifier.".
Of course, here is the Java code you requested: ```java public Collection<ArtifactSpec> getTransientDependencies(ArtifactSpec artifact) { Set<ArtifactSpec> deps = new HashSet<>(); if (this.isDirectDep(artifact)) { deps.addAll(getTransientDeps(artifact)); } if (presolvedDepen...
Create a Java method that does the following: "Get the transient dependencies of the given artifact.".
Of course, here is the Java code you requested: ```java public static <T, U> Collection<T> findResults(Iterator<U> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> filteringTransform) { List<T> result = new ArrayList<T>(); while (self.hasNext()) { U value = self.next(); ...
Create a Java method that does the following: "Find results from iterator using the given closure.".
Of course, here is the Java code you requested: ```java public static <K, V> MapDataStore<K, V> emptyStore() { return (MapDataStore<K, V>) EMPTY_MAP_DATA_STORE; } ``` Hope this helps!
Create a Java method that does the following: "Returns an empty map data store.".
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> switchMapDelayError(Function<? super T, ? extends ObservableSource<? extends R>> mapper) { return switchMapDelayError(mapper, bufferSize()); } ``` Hope ...
Create a Java method that does the following: "Switches the source observable source to an observable source that is delayed until the source observable is completed.".
Of course, here is the Java code you requested: ```java @Override protected ResultSet findReferences(String nodeIdentifier) throws SQLException { if (findReferences == null) { findReferences = dbConnection.prepareStatement(FIND_REFERENCES); } else { findReferences....
Create a Java method that does the following: "Override the findReferences method.".
Of course, here is the Java code you requested: ```java @Procedure(mode = Mode.WRITE) @Description("apoc.periodic.iterate('statement returning items', 'statement per item', {batchSize:1000,iterateList:true,parallel:false,params:{},concurrency:50,retries:0}) YIELD batches, total - run the second statement for each ...
Create a Java method that does the following: "This procedure is used to iterate over a sequence of items in a single thread.".
Of course, here is the Java code you requested: ```java private Method findSupertypeMethod(Object o, String methodName, Class<?>[] types) { Method matchingMethod = null; Method[] methods = o.getClass().getDeclaredMethods(); methodloop: for (Method method : methods) { if (methodName.equa...
Create a Java method that does the following: "Find the supertype method of the given object o.".
Of course, here is the Java code you requested: ```java public void setCommercePaymentMethodGroupRelLocalService( com.liferay.commerce.payment.service.CommercePaymentMethodGroupRelLocalService commercePaymentMethodGroupRelLocalService) { this.commercePaymentMethodGroupRelLocalService = commercePaymentMethodGroupRe...
Create a Java method that does the following: "Sets the commerce payment method group rel local service.".
Of course, here is the Java code you requested: ```java protected static String tryCommands (String[] cmds) { if (cmds == null) { return null; } String output; for (int ii = 0; ii < cmds.length; ii++) { output = runCommand(cmds[ii]); if (output ...
Create a Java method that does the following: "Try to execute the commands in order to get the result.".
Of course, here is the Java code you requested: ```java public static boolean isExpression(String text) { if (text == null) { return false; } text = text.trim(); return text.startsWith("${") || text.startsWith("#{"); } ``` Hope this helps!
Create a Java method that does the following: "Checks if the given text is an expression.".
Of course, here is the Java code you requested: ```java public static String hostNameOfDeployment(final WarMetaData metaData, final String defaultHost) { Collection<String> hostNames = null; if (metaData.getMergedJBossWebMetaData() != null) { hostNames = metaData.getMergedJBossWebMetaData().getVirtualHosts(); ...
Create a Java method that does the following: "Gets the host name of the deployment.".
Of course, here is the Java code you requested: ```java public CmsUrlNameMappingFilter filterLocale(String locale) { if (locale == null) { throw new IllegalArgumentException(); } CmsUrlNameMappingFilter result = new CmsUrlNameMappingFilter(this); result.m_locale = locale; ...
Create a Java method that does the following: "Returns a new filter that only accepts mappings for the given locale.".
Of course, here is the Java code you requested: ```java public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex) throws IOException, InvalidRangeException { Array psArray = readArray(psVar, timeIndex); if (null == aArray) { aArray = aVar.read(); bArray = bVar.read()...
Create a Java method that does the following: "Gets the coordinate array 1D for the two data arrays.".
Of course, here is the Java code you requested: ```java public boolean addRegistration(String topic, Registration registration) { Collection<Registration> registrations = getRegistrations(topic, true); if (registrations.add(registration)) { registrationIdMap.put(registration.getId(), regist...
Create a Java method that does the following: "Add a Registration to a topic.".
Of course, here is the Java code you requested: ```java public void marshall(CreateTagsRequest createTagsRequest, ProtocolMarshaller protocolMarshaller) { if (createTagsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "Creates the given parameter object.".
Of course, here is the Java code you requested: ```java public String build(final UrlMapping mapping, final boolean encodeUrl, final Map<String, String[]> parameters) { List<UIParameter> list = new ArrayList<UIParameter>(); if(parameters != null) { for (Entry<String, String[]> e : paramet...
Create a Java method that does the following: "Build a URL from a Map of parameters.".
Of course, here is the Java code you requested: ```java public static <A, B extends Comparable<B>> Map<A, B> sortByValue(Map<A, B> map) { List<Map.Entry<A, B>> list = Lists.newArrayList(map.entrySet()); Collections.sort(list, new Comparator<Map.Entry<A, B>>() { public int compare(Map.Entry<A, B> o1, Map....
Create a Java method that does the following: "Sort the given map by value.".
Of course, here is the Java code you requested: ```java public void marshall(DeleteConditionalForwarderRequest deleteConditionalForwarderRequest, ProtocolMarshaller protocolMarshaller) { if (deleteConditionalForwarderRequest == null) { throw new SdkClientException("Invalid argument passed to marsh...
Create a Java method that does the following: "marshalls the given deleteConditionalForwarderRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public static String getWebProjectPath(Object currentObject) { Class<? extends Object> class1 = currentObject.getClass(); ClassLoader classLoader = class1.getClassLoader(); URL resource = classLoader.getResource("/"); String path ...
Create a Java method that does the following: "Get the path of the web project.".
Of course, here is the Java code you requested: ```java private void addPostParams(final Request request) { if (friendlyName != null) { request.addPostParam("FriendlyName", friendlyName); } if (apiVersion != null) { request.addPostParam("ApiVersion", apiVersion); ...
Create a Java method that does the following: "Add Post Params.".
Of course, here is the Java code you requested: ```java public static File findInstanceResourcesDirectory( File applicationFilesDirectory, Component component ) { File root = new File( applicationFilesDirectory, Constants.PROJECT_DIR_GRAPH ); File result = new File( "No recipe directory." ); Set<Component> alre...
Create a Java method that does the following: "Find instance resources directory.".
Of course, here is the Java code you requested: ```java public static Map<CxxMetricsFactory.Key, Metric<?>> generateMap(String langKey, String langPropertiesKey) { final String domain = langKey.toUpperCase(Locale.ENGLISH); final Map<CxxMetricsFactory.Key, Metric<?>> metrics = new HashMap<>(); addPub...
Create a Java method that does the following: "Generate a map of metrics for a single language.".
Of course, here is the Java code you requested: ```java static public String toDateTimeStringISO(CalendarDate cd) { if(cd.getDateTime().getMillisOfSecond() == 0) return isof.print( cd.getDateTime() ); else return isof_with_millis_of_second.print(cd.getDateTime()); } ``` Hope this helps!
Create a Java method that does the following: "This method is a convenience method for converting a CalendarDate to an ISO date time string.".
Of course, here is the Java code you requested: ```java public Chalk256 standard(final int index) { startSequence(FG_CODES[index(index, 0, 8)]); endSequence(RESET); return _this(); } ``` Hope this helps!
Create a Java method that does the following: "Sets the Chalk 256 standard code.".
Of course, here is the Java code you requested: ```java public void classLoaderDestroy(DynamicClassLoader loader) { Method destroy = getDestroyMethod(_resource.getClass()); if (destroy == null) return; try { destroy.invoke(_resource); } catch (Throwable e) { log.log(Level.WARN...
Create a Java method that does the following: "Destroy the resource.".
Of course, here is the Java code you requested: ```java public PoolAddOptions withOcpDate(DateTime ocpDate) { if (ocpDate == null) { this.ocpDate = null; } else { this.ocpDate = new DateTimeRfc1123(ocpDate); } return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the ocpDate value for the property.".
Of course, here is the Java code you requested: ```java URI buildUri(String relativePath) { URI uri = null; try { uri = new URI(buildUrl(relativePath)); } catch (URISyntaxException e) { logger.severe("Problem con...
Create a Java method that does the following: "Build a URI from a relative path.".
Of course, here is the Java code you requested: ```java public static String format(final Date date, final String pattern, final TimeZone timeZone) { return format(date, pattern, timeZone, null); } ``` Hope this helps!
Create a Java method that does the following: "Format a date with the specified pattern and time zone.".
Of course, here is the Java code you requested: ```java @Override public JspConfigDescriptor getJspConfigDescriptor() { if (withinContextInitOfProgAddListener) { throw new UnsupportedOperationException(MessageFormat.format( nls.getString("Unsupported.op.from.servlet.context....
Create a Java method that does the following: "Returns the JspConfigDescriptor for this application.".
Of course, here is the Java code you requested: ```java public SingleSignonToken createSSOToken(Map<String, Object> tokenData) throws TokenCreationFailedException { try { TokenService tokenService = getTokenServiceForType(ssoTokenType); SingleSignonTokenImpl ssoToken = new SingleSignonT...
Create a Java method that does the following: "Creates a SingleSignonToken from the token data.".
Of course, here is the Java code you requested: ```java public static List<Element> getElementsByClass(String className, Tag tag, Element rootElement) { if ((rootElement == null) || (className == null) || (className.trim().length() == 0) || (tag == null)) { return null; } className...
Create a Java method that does the following: "Get all elements that have a class with the specified name and tag in the given rootElement.".
Of course, here is the Java code you requested: ```java private boolean isPEI(InstructionHandle handle) throws CFGBuilderException { Instruction ins = handle.getInstruction(); if (!(ins instanceof ExceptionThrower)) { return false; } if (ins instanceof NEW) { r...
Create a Java method that does the following: "Checks if the instruction is a PEI instruction.".
Of course, here is the Java code you requested: ```java @Override public StringBuffer format(Calendar cal, StringBuffer toAppendTo, FieldPosition pos) { TimeZone backupTZ = null; if (cal != calendar && !cal.getType().equals(calendar.getType())) { // Differ...
Create a Java method that does the following: "Override method to format a calendar.".
Of course, here is the Java code you requested: ```java private static Schema getActualRecord(Schema inputSchema) { if (Type.RECORD.equals(inputSchema.getType())) { return inputSchema; } Preconditions.checkArgument(Type.UNION.equals(inputSchema.getType()), "Nested schema is only support with either ...
Create a Java method that does the following: "Get actual record schema.".
Of course, here is the Java code you requested: ```java protected Set<String> getCellularLocations(Match m, String memLabel, String comLabel) { PhysicalEntityChain chain = getChain(m, memLabel, comLabel); return chain.getCellularLocations(); } ``` Hope this helps!
Create a Java method that does the following: "Get cellular locations of the physical entity chain.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.GDD__GOC_ADES: setGOCAdes((byte[])newValue); return; case AfplibPackage.GDD__COMMANDS: getCommands().clear();...
Create a Java method that does the following: "Override the eSet method to set the value of the feature.".
Of course, here is the Java code you requested: ```java public static BatchRecord fromDataSet(DataSet dataSet) { BatchRecord batchRecord = new BatchRecord(); for (int i = 0; i < dataSet.numExamples(); i++) { batchRecord.add(CSVRecord.fromRow(dataSet.get(i))); } return batch...
Create a Java method that does the following: "Create a BatchRecord from a DataSet.".
Of course, here is the Java code you requested: ```java private boolean openDB(File file, Options options) { try { database = JniDBFactory.factory.open(file, options); logger.info("Using JNI Level DB"); return true; } catch (IOException ex1) { try { ...
Create a Java method that does the following: "Open the database.".
Of course, here is the Java code you requested: ```java public void valueChanged(ListSelectionEvent e) { int index = this.getSelectedIndex(); if (index != -1) { int hour = index / 2; int minute = (int)(((float)index / 2 - hour) * 60); calendar.setTime(targetTime); ca...
Create a Java method that does the following: "The valueChanged method is called when the value of the selected time field has been changed.".
Of course, here is the Java code you requested: ```java private String buildMessage( String rawMessage ){ StringBuilder msg = new StringBuilder(); if( changeLogName != null ){ msg.append( changeLogName ).append( ": " ); } if( changeSetName != null ){ msg.append( ...
Create a Java method that does the following: "Build a message for the exception.".
Of course, here is the Java code you requested: ```java private String createImportZipPath(String name) { String path = ""; do { String prefix = RandomStringUtils.randomAlphanumeric(6) + "-"; path = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( Cms...
Create a Java method that does the following: "Creates the import zip path.".
Of course, here is the Java code you requested: ```java public EClass getPGP1() { if (pgp1EClass == null) { pgp1EClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(314); } return pgp1EClass; } ``` Hope this helps!
Create a Java method that does the following: "Get the PGP1 feature.".
Of course, here is the Java code you requested: ```java private static void simpleClassTypeSignature(Result sb, TypeMirror type) throws IOException { switch (type.getKind()) { case DECLARED: DeclaredType dt = (DeclaredType) type; TypeElement te = (TypeEle...
Create a Java method that does the following: "Generates the signature for a class type.".
Of course, here is the Java code you requested: ```java public GeometryIndex create(GeometryIndexType type, int... values) { return fromDelegate(delegate.create(toDelegate(type), values)); } ``` Hope this helps!
Create a Java method that does the following: "Create a new GeometryIndex instance with the specified type and values.".
Of course, here is the Java code you requested: ```java public static boolean isSafeChar(char ch) { if (ch >= 'a' && ch <= 'z') return true; if (ch >= 'A' && ch <= 'Z') return true; if (ch >= '0' && ch <= '9') return true; // loop thru our PRINTABLE strin...
Create a Java method that does the following: "isSafeChar returns true if the char is a safe character".
Of course, here is the Java code you requested: ```java @Override public boolean add(S solution) { boolean solutionInserted = false ; if (solutionList.size() == 0) { solutionList.add(solution) ; solutionInserted = true ; } else { Iterator<S> iterator = solutionList.iterator(); boo...
Create a Java method that does the following: "Add a new individual to the list.".
Of course, here is the Java code you requested: ```java public void hold() { notificationListener = null; setAppForeground(false); if (onMessageReceiverRegistered) { try { appContext.unregisterReceiver(onMessage); } catch (Exception e) { logger.warn("MFPPush:hold() - Exception w...
Create a Java method that does the following: "Hold the application.".
Of course, here is the Java code you requested: ```java public java.lang.String getStaticFile() { java.lang.Object ref = staticFile_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) re...
Create a Java method that does the following: "Gets the staticFile value.".
Of course, here is the Java code you requested: ```java private void initGithubScmScoreSettings() { ScmScoreSettings scmScoreSettings = this.scoreSettings.getScmWidget(); if (null != scmScoreSettings) { scmScoreSettings.setCriteria( Utils.mergeCriteria(this.scoreSettings.getCriteria(), scmScoreSe...
Create a Java method that does the following: "Initialize the Github Scm score settings".
Of course, here is the Java code you requested: ```java public ResponseWrapper addFriends(String username, String...users) throws APIConnectionException, APIRequestException { return _userClient.addFriends(username, users); } ``` Hope this helps!
Create a Java method that does the following: "Add a list of users to a user".
Of course, here is the Java code you requested: ```java private E unlinkLast(Node<E> l) { // assert l == last && l != null; final E element = l.item; final Node<E> prev = l.prev; l.item = null; l.prev = null; // help GC last = prev; if (prev == null) ...
Create a Java method that does the following: "Unlinks the last node.".
Of course, here is the Java code you requested: ```java public Integer getDefaultOnNull(Integer value, Integer defaultValue) { return (value == null ? defaultValue : value); } ``` Hope this helps!
Create a Java method that does the following: "Get the default value on null.".
Of course, here is the Java code you requested: ```java public static void polygon2Dto3D(Polygon2D_F64 polygon2D , Se3_F64 polyToWorld , FastQueue<Point3D_F64> output ) { output.resize(polygon2D.size()); for (int i = 0; i < polygon2D.size(); i++) { Point2D_F64 p2 = polygon2D.get(i); Point3D_F64 p3 = outpu...
Create a Java method that does the following: "Converts a polygon into a 3D image.".
Of course, here is the Java code you requested: ```java protected final PrcEntityPbDelete<RS, IPersistableBase> createPutPrcEntityPbDelete() throws Exception { PrcEntityPbDelete<RS, IPersistableBase> proc = new PrcEntityPbDelete<RS, IPersistableBase>(); proc.setSrvOrm(getSrvOrm()); //assigning fu...
Create a Java method that does the following: "Create a PrcEntityPbDelete object.".
Of course, here is the Java code you requested: ```java public static systementitydata[] get(nitro_service service, systementitydata_args args) throws Exception{ systementitydata obj = new systementitydata(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); syst...
Create a Java method that does the following: "Use this API to fetch all the systementitydata resources that are configured on netscaler. This uses systementitydata_args which is a way to provide additional arguments while fetching the resources.".
Of course, here is the Java code you requested: ```java public static double gradientNoise3D(double fx, double fy, double fz, int ix, int iy, int iz, int seed) { // Randomly generate a gradient vector given the integer coordinates of the // input value. This implementation generates a random number an...
Create a Java method that does the following: "This function is used to compute the 3D gradient noise of a single image image.".
Of course, here is the Java code you requested: ```java public synchronized int read(byte b[], int off, int len) throws IOException { getBufIfOpen(); // Check for closed stream if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException();...
Create a Java method that does the following: "read from the underlying stream into the specified byte array.".
Of course, here is the Java code you requested: ```java public void setColumn(int column, double[] values) { checkIndices(values.length - 1, column); values[column] = values[column]; } ``` Hope this helps!
Create a Java method that does the following: "Sets the value of the column.".
Of course, here is the Java code you requested: ```java public static String getLocalDisplayName(String locale) { String desc = "" + locale; if (locale != null) { String[] langArray = locale.split("_"); Locale loc = null; if (langArray.length == 1) { loc = new Locale(langArr...
Create a Java method that does the following: "Gets the display name of the user in the specified locale.".
Of course, here is the Java code you requested: ```java public static Matcher<JsonElement> maxProperties(final int maxProperties) { return new TypeSafeDiagnosingMatcher<JsonElement>() { @Override protected boolean matchesSafely(JsonElement item, Description mismatchDescription) { ...
Create a Java method that does the following: "Returns a Matcher that matches any Json element that has a maximum number of properties.".
Of course, here is the Java code you requested: ```java public static CommerceAddress[] findByCommerceCountryId_PrevAndNext( long commerceAddressId, long commerceCountryId, OrderByComparator<CommerceAddress> orderByComparator) throws com.liferay.commerce.exception.NoSuchAddressException { return getPersistence...
Create a Java method that does the following: "Returns the commerce addresses before and after the current commerce address in the ordered set.".
Of course, here is the Java code you requested: ```java @Override public boolean existSql(final String fileName) { return Thread.currentThread().getContextClassLoader().getResource(getFilePath(fileName)) != null; } ``` Hope this helps!
Create a Java method that does the following: "Check if the file exists in the database.".
Of course, here is the Java code you requested: ```java public final hqlParser.fromClause_return fromClause() throws RecognitionException { hqlParser.fromClause_return retval = new hqlParser.fromClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token FROM58=null; Token COMMA61=null; ...
Create a Java method that does the following: "Use this method to match a FROM ^ fromClause request.".
Of course, here is the Java code you requested: ```java public void setAll(String attributeName, String busClassNameWithDots, String busClassName, boolean isNullable, RelatedFinder relatedFinder, Map properties, boolean transactional) { timestampAttribute.setAll(attributeName, busClassNameWithDots, busCl...
Create a Java method that does the following: "Sets all attributes in the managed object.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @SafeVarargs public static <G, ERR> Or<G, Every<ERR>> when(Or<? extends G, ? extends Every<? extends ERR>> or, Function<? super G, ? extends Validation<ERR>>... validations) { return when(or, Stream.of(validations)); } `...
Create a Java method that does the following: "Returns a new instance of the CID with validation applied to the given Or.".
Of course, here is the Java code you requested: ```java @Override public <T> HTMLDisplayer<T> getHTMLDisplayer(Type targetType, String roleHint) throws HTMLDisplayerException { try { HTMLDisplayer<T> component; ComponentManager componentManager = this.componentManagerProvider.ge...
Create a Java method that does the following: "Gets the HTML displayer for the given target type and role.".
Of course, here is the Java code you requested: ```java private void adjustTree(IndexTreePath<E> subtree) { final Logging log = getLogger(); if(log.isDebugging()) { log.debugFine("Adjust tree " + subtree + "\n"); } // get the root of the subtree int nodeIndex = subtree.getIndex(); N node...
Create a Java method that does the following: "Adjusts the tree.".
Of course, here is the Java code you requested: ```java public void marshall(ItemResponse itemResponse, ProtocolMarshaller protocolMarshaller) { if (itemResponse == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarsha...
Create a Java method that does the following: "Converts a ItemResponse object to a JSON object.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public Class<Model> getModel(String modelPackagesCsv) throws TechnicalException { if (modelPackagesCsv != null && !"".equals(modelPackagesCsv)) { final String[] packages = modelPackagesCsv.split...
Create a Java method that does the following: "Get the model from the CSV file.".
Of course, here is the Java code you requested: ```java public List<CharacterBlueprintsResponse> getCharactersCharacterIdBlueprints(Integer characterId, String datasource, String ifNoneMatch, Integer page, String token) throws ApiException { ApiResponse<List<CharacterBlueprintsResponse>> resp = get...
Create a Java method that does the following: "Get list of cucumber base class for a character Get list of cucumber base class for a character".
Of course, here is the Java code you requested: ```java public void addState(TrafficLightState state) { if(this.states == null) this.states = new ArrayList<TrafficLightState>(); this.states.add(state); } ``` Hope this helps!
Create a Java method that does the following: "Add a traffic light state to the list of traffic light states.".
Of course, here is the Java code you requested: ```java @Override public synchronized void close() throws IOException { // TODO(zac) Determine the behavior when closing the context during operations. if (!mClosed) { mClosed = true; if (mCachingEnabled) { Factory.FILESYSTEM_CACHE.remove(ne...
Create a Java method that does the following: "Close the context.".
Of course, here is the Java code you requested: ```java public void getGuildTreasuryInfo(String id, String api, Callback<List<GuildTreasury>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); gw2API.getGuildTreasu...
Create a Java method that does the following: "Get Guild Treasury info for a Guild".