code stringlengths 160 48.7k | prompt stringlengths 55 1.51k |
|---|---|
Of course, here is the Java code you requested:
```java
public ChronicleMapBuilder<K, V> mapMethods(MapMethods<K, V, ?> mapMethods) {
Objects.requireNonNull(mapMethods);
this.methods = mapMethods;
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the map methods.". |
Of course, here is the Java code you requested:
```java
public void add(BytesRef payload) {
// check space first
// ba is the backing array for data
if (payload.length() > ba.available()) {
if (autoFlush) {
flush();
}
else {
th... | Create a Java method that does the following: "Add a single bytes reference to the cache.". |
Of course, here is the Java code you requested:
```java
public void setXPEXTENT(Integer newXPEXTENT) {
Integer oldXPEXTENT = xpextent;
xpextent = newXPEXTENT;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.PTD1__XPEXTENT, oldXPEXTENT, xpextent));
}
```
Hope ... | Create a Java method that does the following: "Sets the XPEXTENT value.". |
Of course, here is the Java code you requested:
```java
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.adwords.axis.v201809.cm.DraftServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
... | Create a Java method that does the following: "Gets the Remote object that is bound to the specified service interface.". |
Of course, here is the Java code you requested:
```java
public static LoginConfigMetaData getLoginConfig(final JBossWebMetaData jbossWebMD) {
LoginConfigMetaData loginConfigMD = jbossWebMD.getLoginConfig();
if (loginConfigMD == null) {
loginConfigMD = new LoginConfigMetaData();
... | Create a Java method that does the following: "Gets the login config.". |
Of course, here is the Java code you requested:
```java
public SearchExpression withSubExpressions(SearchExpression... subExpressions) {
if (this.subExpressions == null) {
setSubExpressions(new java.util.ArrayList<SearchExpression>(subExpressions.length));
}
for (SearchExpression el... | Create a Java method that does the following: "A list of SearchExpression objects that contain a single sub - expression.". |
Of course, here is the Java code you requested:
```java
public HandyDate date(Object expression) {
if (expression instanceof LocalDate) {
return create((LocalDate) expression);
}
if (expression instanceof LocalDateTime) {
return create((LocalDateTime) expression);
... | Create a Java method that does the following: "Create a HandyDate object from the given object.". |
Of course, here is the Java code you requested:
```java
public Observable<Page<LongTermRetentionBackupInner>> listByDatabaseNextAsync(final String nextPageLink) {
return listByDatabaseNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<LongTermRetentionBackupInner>>, Page... | Create a Java method that does the following: "Gets a list of Long Term Retention Backups.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "unchecked", "rawtypes" })
protected <E> void saveAllForeignObjectsToCache(E data) throws SQLException, IllegalAccessException, InvocationTargetException {
// copy children on memory
// set children to null on parents so... | Create a Java method that does the following: "Saves all foreign objects in the given data object to the cache.". |
Of course, here is the Java code you requested:
```java
public String toCode() {
StringBuilder source = new StringBuilder();
source.append(StringUtils.trimToEmpty(scope)).append(ClassCode.BLANK_STRING);
if (StringUtils.isEmpty(returnType)) {
source.append("void ");
} el... | Create a Java method that does the following: "Returns a string representation of the class.". |
Of course, here is the Java code you requested:
```java
public static TreeMap<String, String> getBodies(CmsObject cms, String currWpPath) throws CmsException {
return getElements(cms, CmsWorkplace.VFS_DIR_DEFAULTBODIES, currWpPath, true);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a map of all body elements for the given path.". |
Of course, here is the Java code you requested:
```java
public List<Long> getExtraDataFields() {
if (mExtraDataFields.getClass().isInstance(UNMODIFIABLE_LIST_OF_LONG)) {
return mExtraDataFields;
}
else {
return Collections.unmodifiableList(mExtraDataFields);
}
... | Create a Java method that does the following: "Gets the extra data fields.". |
Of course, here is the Java code you requested:
```java
private static <T extends Annotation, R> Builder<R> getAnnotatedInstances(
AnnotatedElement method, AnnotatedElement clazz, Class<T> annotationType, Class<R> resultType) {
final Builder<R> builder = new Builder<>();
Stream.concat(findA... | Create a Java method that does the following: "Gets annotated instances.". |
Of course, here is the Java code you requested:
```java
@Indexable(type = IndexableType.REINDEX)
@Override
public CPSpecificationOption addCPSpecificationOption(
CPSpecificationOption cpSpecificationOption) {
cpSpecificationOption.setNew(true);
return cpSpecificationOptionPersistence.update(cpSpecificationOpt... | Create a Java method that does the following: "Adds the cp specification option to the database. Also notifies the appropriate model listeners.". |
Of course, here is the Java code you requested:
```java
public void setFollowParentFocus(final boolean follow) {
if (follow != mFollowParentFocus) {
mFollowParentFocus = follow;
Log.d(Log.SUBSYSTEM.WIDGET, TAG, "setFollowParentFocus(%s): calling registerPickable",
getN... | Create a Java method that does the following: "Set whether the parent focus should be shown in the child list.". |
Of course, here is the Java code you requested:
```java
private static final void registerPrimitiveClassPair(Class<?> left, Class<?> right) {
PRIMITIVE_TYPE_COMPATIBLE_CLASSES.put(left, right);
PRIMITIVE_TYPE_COMPATIBLE_CLASSES.put(right, left);
}
```
Hope this helps! | Create a Java method that does the following: "Register two classes for compatibility.". |
Of course, here is the Java code you requested:
```java
public Map<String, Object> createNodeProperties(Object entity, EntityMetadata m)
{
Map<String, Object> props = new HashMap<String, Object>();
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
... | Create a Java method that does the following: "Creates a Map of properties for the node.". |
Of course, here is the Java code you requested:
```java
private static Type getType(final char[] buf, final int off) {
int len;
switch (buf[off]) {
case 'V':
return VOID_TYPE;
case 'Z':
return BOOLEAN_TYPE;
case 'C':
return CHAR_TYPE;
... | Create a Java method that does the following: "Gets the type from the char array.". |
Of course, here is the Java code you requested:
```java
public static boolean safeCloseAll(Iterable<? extends Closeable> closeables) {
final Iterator<? extends Closeable> it = closeables.iterator();
boolean result = true;
while (it.hasNext()) {
result &= safeClose(it.next());
... | Create a Java method that does the following: "Safe close all the given closeables.". |
Of course, here is the Java code you requested:
```java
Type unaryPromotion(Type t) {
Type unboxed = types.unboxedTypeOrType(t);
switch (unboxed.getTag()) {
case BYTE:
case SHORT:
case CHAR:
return syms.intType;
default:
re... | Create a Java method that does the following: "Unboxed Promotion.". |
Of course, here is the Java code you requested:
```java
@Nonnull
public JSDefinedClass _class (@Nonnull @Nonempty final String sName) throws JSNameAlreadyExistsException
{
final JSDefinedClass aDefinedClass = new JSDefinedClass (sName);
return addDeclaration (aDefinedClass);
}
```
Hope this helps! | Create a Java method that does the following: "Create a new class declaration.". |
Of course, here is the Java code you requested:
```java
public static int cusparseShyb2csr(
cusparseHandle handle,
cusparseMatDescr descrA,
cusparseHybMat hybA,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA)
{
return c... | Create a Java method that does the following: "Compute the sparse matrix of a unique set of attributes.". |
Of course, here is the Java code you requested:
```java
private void checkQualityProfilesConsistency(ScannerReport.Metadata metadata, Organization organization) {
List<String> profileKeys = metadata.getQprofilesPerLanguage().values().stream()
.map(QProfile::getKey)
.collect(toList(metadata.getQprofiles... | Create a Java method that does the following: "Check if the quality profiles are consistent". |
Of course, here is the Java code you requested:
```java
public static String[] split(String input, char delimiter){
if(input == null) throw new NullPointerException("input cannot be null");
final int len = input.length();
// find the number of strings to split into
int nSplits... | Create a Java method that does the following: "Splits the input string into an array of strings.". |
Of course, here is the Java code you requested:
```java
public <T> void serviceClass(Class<T> serviceClass)
{
if (Vault.class.isAssignableFrom(serviceClass)) {
_validatorVault.vaultClass(serviceClass);
}
else {
validateServiceClass(serviceClass);
}
if (Modifier.isAbstract(service... | Create a Java method that does the following: "Validate the service class.". |
Of course, here is the Java code you requested:
```java
@Get("/musics/search")
public void search(Music music) {
String title = MoreObjects.firstNonNull(music.getTitle(), "");
result.include("musics", this.musicDao.searchSimilarTitle(title));
}
```
Hope this helps! | Create a Java method that does the following: "Search for a music.". |
Of course, here is the Java code you requested:
```java
private Content getClassInheritenceTree(Type type) {
Type sup;
HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL);
classTreeUl.addStyle(HtmlStyle.inheritance);
Content liTree = null;
do {
sup = utils.getFirstVisibl... | Create a Java method that does the following: "Get the class inheritance tree for the type.". |
Of course, here is the Java code you requested:
```java
public ConditionFactory pollInterval(long pollInterval, TimeUnit unit) {
PollInterval fixedPollInterval = new FixedPollInterval(new Duration(pollInterval, unit));
return new ConditionFactory(alias, timeoutConstraint, fixedPollInterval, definePollD... | Create a Java method that does the following: "Creates a new condition factory that polls the cache for a period of time.". |
Of course, here is the Java code you requested:
```java
public int compare(final SnomedConcept o1, final SnomedConcept o2) {
if (o1 == o2) return 0;
if (o1 != null) {
if (o2 == null) return 1;
else return o1.phraseText.compareTo(o2.phraseText);
}
return -1;
}... | Create a Java method that does the following: "Compare two SnomedConcept objects.". |
Of course, here is the Java code you requested:
```java
public void waitOnBackgroundOp()
{
ExecutorService jobRunner = getJobRunner();
if( jobRunner != null )
{
final Object wait = new Object();
synchronized( wait ) //## wtf?
{
BackgroundOperation.instance().doBackgroundOp( () -... | Create a Java method that does the following: "Wait on background operation.". |
Of course, here is the Java code you requested:
```java
private static boolean shouldRetry(final int status, final String content) {
switch (status) {
case 200:
return false;
case 404:
return analyse404Response(content);
case 500:
... | Create a Java method that does the following: "Checks if the response should be retried.". |
Of course, here is the Java code you requested:
```java
public static TableSchema fromTypeInfo(TypeInformation<?> typeInfo) {
if (typeInfo instanceof CompositeType<?>) {
final CompositeType<?> compositeType = (CompositeType<?>) typeInfo;
// get field names and types from composite type
final String[] fieldN... | Create a Java method that does the following: "Creates a table schema from a type information object.". |
Of course, here is the Java code you requested:
```java
public MemberSubstitution replaceWithField(ElementMatcher<? super FieldDescription> matcher) {
return replaceWith(new Substitution.ForFieldAccess.OfMatchedField(matcher));
}
```
Hope this helps! | Create a Java method that does the following: "Replaces this substitution with a field that matches the given element matcher.". |
Of course, here is the Java code you requested:
```java
static boolean isValidLuhnNumber(@Nullable String cardNumber) {
if (cardNumber == null) {
return false;
}
boolean isOdd = true;
int sum = 0;
for (int index = cardNumber.length() - 1; index >= 0; index--) {
... | Create a Java method that does the following: "Check if the given string is a valid luhn number.". |
Of course, here is the Java code you requested:
```java
public static QueryWrapper parseDynamicQuery(QueryExpression query)
{
ArrayList<Object> params = new ArrayList<Object>();
long s = System.currentTimeMillis();
String sqlQuery = "SELECT * " + parseDynamicQuery( query, 0, null, params );
lo... | Create a Java method that does the following: "Parse a dynamic query for
.". |
Of course, here is the Java code you requested:
```java
private void tryInitialize(boolean checkTermination) {
if (runState == 0) { // bootstrap by locking static field
int p = config & SMASK;
int n = (p > 1) ? p - 1 : 1; // ensure at least 2 slots
n |= n >>> 1; // create... | Create a Java method that does the following: "Initialize the class.". |
Of course, here is the Java code you requested:
```java
public void marshall(PutEventsResultEntry putEventsResultEntry, ProtocolMarshaller protocolMarshaller) {
if (putEventsResultEntry == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given PutEventsResultEntry object to the JSON file.". |
Of course, here is the Java code you requested:
```java
public void setChanged(boolean changed) {
m_changedStyleVar.setValue(
changed
? I_CmsToolbarButtonLayoutBundle.INSTANCE.toolbarButtonCss().elementInfoChanged()
: I_CmsToolbarButtonLayoutBundle.INSTANCE.toolbarButt... | Create a Java method that does the following: "Sets the changed flag.". |
Of course, here is the Java code you requested:
```java
private SSLSocketFactory getSocketFactory(String id) throws IOException {
// first use?
SSLSocketFactory socketFactory = socketFactoryMap.get(id);
if (socketFactory == null) {
// the SSLConfig is optional, so if it's not there,... | Create a Java method that does the following: "Gets the SSLSocketFactory for the specified id.". |
Of course, here is the Java code you requested:
```java
public void marshall(ListSamplesRequest listSamplesRequest, ProtocolMarshaller protocolMarshaller) {
if (listSamplesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given request to the JSON API.". |
Of course, here is the Java code you requested:
```java
static public WsByteBuffer[] putByteArray(WsByteBuffer[] buffers, byte[] value, BNFHeadersImpl bnfObj) {
// LIDB2356-41: byte[]/offset/length support
return putByteArray(buffers, value, 0, value.length, bnfObj);
}
```
Hope this helps! | Create a Java method that does the following: "This method is used to put a byte array into the buffers array.". |
Of course, here is the Java code you requested:
```java
@ConditionalOnMissingBean(GrpcChannelFactory.class)
@ConditionalOnClass(name = {"io.netty.channel.Channel", "io.grpc.netty.NettyChannelBuilder"})
@Bean
public GrpcChannelFactory nettyGrpcChannelFactory(final GrpcChannelsProperties properties,
... | Create a Java method that does the following: "NettyChannelFactory bean.". |
Of course, here is the Java code you requested:
```java
@Override
public final String getFor(final Class<?> pClass, final String pThingName) {
if ("entityEdit".equals(pThingName) && pClass == Cart.class) {
return null;
} else if (pClass == CustOrder.class) {
if ("entitySave".equals(pThingName)) {... | Create a Java method that does the following: "Override the getFor method for the given class and thing name.". |
Of course, here is the Java code you requested:
```java
public static void write(final X509Certificate certificate, final @NonNull File file,
KeyFileFormat fileFormat) throws IOException, CertificateEncodingException
{
write(certificate, new FileOutputStream(file), fileFormat);
}
```
Hope this helps! | Create a Java method that does the following: "Write a certificate to a file using the specified file format.". |
Of course, here is the Java code you requested:
```java
public static <K,V> MapFactory<K,V> cow(MapFactory<K,V> underMapFact) {
throw new UnsupportedOperationException("Not implemented yet");
}
```
Hope this helps! | Create a Java method that does the following: "Returns a new MapFactory that wraps the given MapFactory.". |
Of course, here is the Java code you requested:
```java
public void onReset(WAMResolvingMachineDPI dpi)
{
internalRegisters = new InternalRegisterBean(0, 0, 0, 0, 0, 0, 0, 0, 0, false);
internalRegisters.addPropertyChangeListener(registerSetMonitor);
internalRegisters.addPropertyChangeListe... | Create a Java method that does the following: "Reset the image.". |
Of course, here is the Java code you requested:
```java
public void marshall(ReplicaSettingsDescription replicaSettingsDescription, ProtocolMarshaller protocolMarshaller) {
if (replicaSettingsDescription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}... | Create a Java method that does the following: "marshalls the given ReplicaSettingsDescription object to the JSON file.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <K extends Comparable<? super K>, V> ImmutableSortedMap<K, V> of(
K k1, V v1, K k2, V v2) {
return ofEntries(entryOf(k1, v1), entryOf(k2, v2));
}
```
Hope this helps! | Create a Java method that does the following: "Returns an immutable sorted map of the two elements of the specified key - value pairs.". |
Of course, here is the Java code you requested:
```java
void applyTo(android.icu.util.SimpleTimeZone stz) {
if (sy != -1) {
stz.setStartYear(sy);
}
if (sm != -1) {
if (sdm == -1) {
stz.setStartRule(sm, sdwm, sdw, st);
} else if (sdw == -1) {
... | Create a Java method that does the following: "Set the calendar time zone to the given time zone.". |
Of course, here is the Java code you requested:
```java
public long read(OutputStream stream, long length) throws IOException
{
if (stream instanceof FileOutputStream)
{
// use NIO
return channel.transferTo(0, length, ((FileOutputStream)stream).getChannel());
}
else
... | Create a Java method that does the following: "Reads a number of bytes from the underlying stream.". |
Of course, here is the Java code you requested:
```java
private void userInfoInit() {
boolean first = true;
userId = null;
userLocale = null;
userName = null;
userOrganization = null;
userDivision = null;
if (null != authentications) {
for (Authentication auth : authentications) {
userId = combine... | Create a Java method that does the following: "This method initializes the user info.". |
Of course, here is the Java code you requested:
```java
public void addFieldList(FieldList fieldList, int iLocation)
{
if (fieldList == null)
return;
if (m_vFieldListList == null)
m_vFieldListList = new Vector<FieldList>();
for (int i = 0; ; i++)
{ // Step ... | Create a Java method that does the following: "Add the FieldList to the list of FieldList.". |
Of course, here is the Java code you requested:
```java
@Override
protected void stopInner() {
/*
* TODO REST-Server Need to handle inflight operations. What happens to
* the existing async operations when a channel.close() is issued in
* Netty?
*/
if(this.nettyS... | Create a Java method that does the following: "Stop the inner class.". |
Of course, here is the Java code you requested:
```java
public static ArrayList<ResultsPartition> get(CaptureSearchResults results,
WaybackRequest wbRequest) {
return get(results, wbRequest, null);
}
```
Hope this helps! | Create a Java method that does the following: "Get the results partitions from a capture search results object.". |
Of course, here is the Java code you requested:
```java
public static Range trim(SequenceQuality quality, QualityTrimmerParameters parameters) {
return trim(quality, parameters, new Range(0, quality.size()));
}
```
Hope this helps! | Create a Java method that does the following: "Trims the quality from the beginning of the sequence.". |
Of course, here is the Java code you requested:
```java
public void setStyleClass(java.lang.String styleClass) {
getStateHelper().put(PropertyKeys.styleClass, styleClass);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the styleClass property.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Nullable
public <T> T get(Key<T> key) {
return (T) data.get(key);
}
```
Hope this helps! | Create a Java method that does the following: "Get the value of the key in the data.". |
Of course, here is the Java code you requested:
```java
public void setAttributeValueString(String attributeName, String value, int index) {
m_entity.setAttributeValue(attributeName, value, index);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the value of an attribute in the entity.". |
Of course, here is the Java code you requested:
```java
public final String formatDin5008National(final String pphoneNumber, final String pcountryCode) {
return this.formatDin5008National(this.parsePhoneNumber(pphoneNumber, pcountryCode));
}
```
Hope this helps! | Create a Java method that does the following: "format phone number in DIN 5008 national format.". |
Of course, here is the Java code you requested:
```java
public void marshall(UpdateBackupPlanRequest updateBackupPlanRequest, ProtocolMarshaller protocolMarshaller) {
if (updateBackupPlanRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... | Create a Java method that does the following: "marshalls the given updateBackupPlanRequest to the JSON object.". |
Of course, here is the Java code you requested:
```java
private void getNetworkInfo() {
// Create a listener to check for new network connections (e.g. switching from mobile to Wifi, or losing internet connection)
NetworkConnectionListener listener = new NetworkConnectionListener() {
@Override
public void n... | Create a Java method that does the following: "Get the network info". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public C merge(final C other) {
return (C) ConfigurationUtils.defaultMerge((ConfigurationComponent) this, (ConfigurationComponent) other);
}
```
Hope this helps! | Create a Java method that does the following: "Merge two NCSA SEGMENTS.". |
Of course, here is the Java code you requested:
```java
public void setChaincodeInputStream(InputStream chaincodeInputStream) throws InvalidArgumentException {
if (chaincodeInputStream == null) {
throw new InvalidArgumentException("Chaincode input stream may not be null.");
}
if (ch... | Create a Java method that does the following: "Set the input stream of chaincode.". |
Of course, here is the Java code you requested:
```java
@Override
public Object getObject( final String key )
throws
UtilException
{
return formatObject( key, getRequiredPropValue( key ) );
}
```
Hope this helps! | Create a Java method that does the following: "Get the object for a SECTYPE.". |
Of course, here is the Java code you requested:
```java
public <T> ClaimValue<Optional<T>> generalClaimValueProducer(InjectionPoint ip) {
String name = getName(ip);
ClaimValueWrapper<Optional<T>> wrapper = new ClaimValueWrapper<>(name);
T value = getValue(name, false);
Optional<T> optVa... | Create a Java method that does the following: "This method is used to create a ClaimValue object that can be used to produce a value for a single InjectionPoint.". |
Of course, here is the Java code you requested:
```java
public Element insertByKey(Object key, Object object)
{
Element element = new Element(this, key, object);
add(element);
return element;
}
```
Hope this helps! | Create a Java method that does the following: "Insert a new element into the cache.". |
Of course, here is the Java code you requested:
```java
public void compile(File[] files) throws CompilationFailedException {
CompilationUnit unit = new CompilationUnit(configuration);
unit.addSources(files);
unit.compile();
}
```
Hope this helps! | Create a Java method that does the following: "Compiles the specified files.". |
Of course, here is the Java code you requested:
```java
public void setYBase(Integer newYBase) {
Integer oldYBase = yBase;
yBase = newYBase;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.IID__YBASE, oldYBase, yBase));
}
```
Hope this helps! | Create a Java method that does the following: "Sets the YBase value.". |
Of course, here is the Java code you requested:
```java
private void connectToNeighbors(int x, int y ) {
List<LineSegment2D_F32> lines = grid.get(x,y);
Iterator<LineSegment2D_F32> iter = lines.iterator();
while( iter.hasNext() )
{
LineSegment2D_F32 l = iter.next();
boolean connected = false;
if( con... | Create a Java method that does the following: "Connect the lines in the grid to the neighbors of the line". |
Of course, here is the Java code you requested:
```java
protected int rethink ()
{
// recompute our "area of influence"
computeInfluentialBounds();
// Log.info("Rethinking vb:" + StringUtil.toString(_vbounds) +
// " ul:" + StringUtil.toString(_ulpos) +
// ... | Create a Java method that does the following: "Rethink the image.". |
Of course, here is the Java code you requested:
```java
public static void setupBaggingClassifiers(IteratedSingleClassifierEnhancer bagging) throws Exception {
bagging.m_Classifiers = Classifier.makeCopies(bagging.m_Classifier, bagging.m_NumIterations);
}
```
Hope this helps! | Create a Java method that does the following: "Sets up the bagging classifiers.". |
Of course, here is the Java code you requested:
```java
public BaseField setupField(int iFieldSeq)
{
BaseField field = null;
//if (iFieldSeq == 0)
//{
// field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
// field.setHidden(true);
//}
... | Create a Java method that does the following: "Set up the Field for this BaseContainer.". |
Of course, here is the Java code you requested:
```java
public <E extends Enum<E> & IApiError> void setApiErrorEnum(Class<E> apiErrorClazz) {
this.apiErrorClazz = apiErrorClazz;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the enum of the API error class.". |
Of course, here is the Java code you requested:
```java
public static MachineTypeId of(String project, String zone, String type) {
return new MachineTypeId(project, zone, type);
}
```
Hope this helps! | Create a Java method that does the following: "Returns a machine type identifier given project zone and type names.". |
Of course, here is the Java code you requested:
```java
public static String decode(String rot, int offset, boolean isDecodeNumber) {
final int len = rot.length();
final char[] chars = new char[len];
for (int i = 0; i < len; i++) {
chars[i] = decodeChar(rot.charAt(i), offset, isDecodeNumber);
}
re... | Create a Java method that does the following: "Decodes a String with the given offset.". |
Of course, here is the Java code you requested:
```java
protected ConnectionFactory prepareConnectionFactory(final String ldapURL) {
val cc = ConnectionConfig.newConnectionConfig(this.connectionConfig);
cc.setLdapUrl(ldapURL);
return new DefaultConnectionFactory(cc);
}
```
Hope this helps! | Create a Java method that does the following: "Prepare connection factory.". |
Of course, here is the Java code you requested:
```java
public LazyArray getJSONArray(String key) throws LazyException{
LazyNode token=getFieldToken(key);
if(token.type!=LazyNode.ARRAY)throw new LazyException("Requested value is not an array",token);
LazyArray arr=new LazyArray(token);
arr.parent=this;
retur... | Create a Java method that does the following: "Returns the JSON array stored in this object for the given key.". |
Of course, here is the Java code you requested:
```java
public static Pattern controlsStateChangeThroughControllerSmallMolecule(Blacklist blacklist)
{
Pattern p = new Pattern(SequenceEntityReference.class, "upper controller ER");
p.add(linkedER(true), "upper controller ER", "upper controller generic ER");
p.add... | Create a Java method that does the following: "Pattern for a small molecule that controls state change through a controller.". |
Of course, here is the Java code you requested:
```java
private void safeSetPathPermission(Path path, OwnerAndPermission ownerAndPermission) {
try {
if (ownerAndPermission.getFsPermission() != null) {
this.fs.setPermission(path, ownerAndPermission.getFsPermission());
}
} catch (IOException... | Create a Java method that does the following: "Safe set path permission.". |
Of course, here is the Java code you requested:
```java
public Grid grid(double[][][] data) {
if (base.dimension != 2) {
throw new IllegalArgumentException("Grid can be only painted in a 2D canvas. Try surface() for 3D grid.");
}
Grid grid = new Grid(data);
add(grid);
... | Create a Java method that does the following: "Create a grid in the canvas.". |
Of course, here is the Java code you requested:
```java
@Override
public void findOne(String sql,
Object[] params,
Result<Cursor> result)
{
_db.findOne(sql, result, params);
}
```
Hope this helps! | Create a Java method that does the following: "Override the findOne method in the database.". |
Of course, here is the Java code you requested:
```java
@Override
public void setLogWriter(PrintWriter out) throws SQLException
{
HikariPool p = pool;
if (p != null) {
p.getUnwrappedDataSource().setLogWriter(out);
}
}
```
Hope this helps! | Create a Java method that does the following: "Set the log writer.". |
Of course, here is the Java code you requested:
```java
public void setIncludeLogcat(final boolean includeLogcat) {
final int versionCode = this.versionCode;
final String versionName = this.versionName;
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder ... | Create a Java method that does the following: "Sets whether logcat is enabled.". |
Of course, here is the Java code you requested:
```java
@Override
public IdDt toUnqualified() {
if (isLocal() || isUrn()) {
return new IdDt(getValueAsString());
}
return new IdDt(getResourceType(), getIdPart(), getVersionIdPart());
}
```
Hope this helps! | Create a Java method that does the following: "Returns an unqualified IdDt for this Id.". |
Of course, here is the Java code you requested:
```java
private void updateConversationAdvertiserIdentifier(Conversation conversation) {
checkConversationQueue();
try {
Configuration config = Configuration.load();
if (config.isCollectingAdID()) {
AdvertisingIdClientInfo info = AdvertiserManager.getAdver... | Create a Java method that does the following: "Update the conversation advertiser identifier.". |
Of course, here is the Java code you requested:
```java
public void marshall(GetSdkTypesRequest getSdkTypesRequest, ProtocolMarshaller protocolMarshaller) {
if (getSdkTypesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | Create a Java method that does the following: "marshalls the given GetSdkTypesRequest to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
public final String encode(byte[] bytes, int off, int len) {
checkNotNull(bytes);
checkPositionIndexes(off, off + len, bytes.length);
CharOutput result = stringBuilderOutput(maxEncodedSize(len));
ByteOutput byteOutput = encodingStream(result);
... | Create a Java method that does the following: "Encode a byte array into a UTF - 8 string.". |
Of course, here is the Java code you requested:
```java
public static Cluster getCluster(ZkClient zkClient) {
Cluster cluster = new Cluster();
List<String> nodes = getChildrenParentMayNotExist(zkClient, BrokerIdsPath);
for (String node : nodes) {
final String brokerInfoString = read... | Create a Java method that does the following: "Get a Cluster object from the ZK client.". |
Of course, here is the Java code you requested:
```java
public byte[] toByteArray() throws IOException {
ByteArrayWriter baw = new ByteArrayWriter();
try {
baw.writeInt(flags);
if (version > 3)
baw.write(type);
if (isFlagSet(SSH_FILEXFER_ATTR_SIZE)) {
baw.write(size.toByteArray());
}
if ... | Create a Java method that does the following: "Write the contents of this file to a byte array.". |
Of course, here is the Java code you requested:
```java
private void handleFinishButtonTextIntent(@NonNull final Bundle extras) {
CharSequence text = extras.getString(EXTRA_FINISH_BUTTON_TEXT);
if (!TextUtils.isEmpty(text)) {
setFinishButtonText(text);
}
}
```
Hope this helps! | Create a Java method that does the following: "Handles the intent extra which specifies the text of the finish button.". |
Of course, here is the Java code you requested:
```java
public static final String roll(String isoString, int field, boolean up)
throws ParseException {
return roll(isoString, DATETIME_PATTERN, field, up);
}
```
Hope this helps! | Create a Java method that does the following: "Roll a string to the next digit of the ISO 8601 date.". |
Of course, here is the Java code you requested:
```java
private static double getDurationInSecs(
ViewData.AggregationWindowData.CumulativeData cumulativeData) {
return toDoubleSeconds(cumulativeData.getEnd().subtractTimestamp(cumulativeData.getStart()));
}
```
Hope this helps! | Create a Java method that does the following: "Get duration in seconds from the given CumulativeData.". |
Of course, here is the Java code you requested:
```java
public Notification[] readNotifications(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
final NotificationRecord[] records = readNotificationRecords(in);
final Notification[] ret = new Notification[records.length]... | Create a Java method that does the following: "Read the list of notifications from the specified input stream.". |
Of course, here is the Java code you requested:
```java
public static Expression arrayReplace(String expression, Expression value1, Expression value2, long n) {
return arrayReplace(x(expression), value1, value2, n);
}
```
Hope this helps! | Create a Java method that does the following: "Returned expression results in a new array of n elements.". |
Of course, here is the Java code you requested:
```java
public static void sendNackToPebble(final Context context, final int transactionId)
throws IllegalArgumentException {
if ((transactionId & ~0xff) != 0) {
throw new IllegalArgumentException(String.format(
"trans... | Create a Java method that does the following: "Send a nack message to the Pebble.". |
Of course, here is the Java code you requested:
```java
static boolean isSymbolChar(int ch) {
int t = Character.getType(ch);
return t == Character.MATH_SYMBOL || t == Character.CURRENCY_SYMBOL || t == Character.MODIFIER_SYMBOL || t == Character.OTHER_SYMBOL;
}
```
Hope this helps! | Create a Java method that does the following: "Is the given character a symbol character.". |
Of course, here is the Java code you requested:
```java
public void resolveSortDirection() {
AbstractPlanNode outerTable = m_children.get(0);
if (m_joinType == JoinType.FULL) {
// Disable the usual optimizations for ordering join output by
// outer table only. In case of FULL jo... | Create a Java method that does the following: "Resolve the sort direction of the join.". |
Of course, here is the Java code you requested:
```java
public D getDestination(final S source){
try {
return mapper.nullVSouAllAll(source);
} catch (Exception e) {
JmapperLog.error(e);
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the destination.". |
Of course, here is the Java code you requested:
```java
@Override public String convertType(String _typeDesc, boolean useClassModel, boolean isLocal) {
if (_typeDesc.equals("Z") || _typeDesc.equals("boolean")) {
return (cvtBooleanToChar);
} else if (_typeDesc.equals("[Z") || _typeDesc.equals("bool... | Create a Java method that does the following: "Convert the type to the real Java type.". |
Of course, here is the Java code you requested:
```java
public void importAccessControlEntries(
CmsDbContext dbc,
CmsResource resource,
List<CmsAccessControlEntry> acEntries)
throws CmsException {
I_CmsUserDriver userDriver = getUserDriver(dbc);
userDriver.removeAccessContr... | Create a Java method that does the following: "Import the given list of access control entries into the user driver.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.