from django.db import models
from django.utils.translation import gettext_lazy as _
class MyThing(models.Model):
name = models.CharField(_('name'), help_text=_('This is the help text'))
class Meta:
verbose_name = _('my thing')
verbose_name_plural = _('my things')
public class Example {
private static final String[] catsNames = { "Васька", "Матроскин" };
public static boolean contains(String[] array, String value) {
for (String item : array)
if (item.equals(value))
return true;
return false;
}
public static void main(String[] args) {
String name = args[0];
if (contains(catsNames, name)) {
// В массиве содержится строка, которую пользователь
// передал первым аргументом командной строки
}
else {
// Строка не содержится в массиве
}
}
}
versions.wildfly
берётся из одноимённого тега в секции properties
.Platform.runLater((() -> someLabel.setText("Hello"));
public class Example extends Application {
...
btn.setOnAction(act -> {
Service<Void> service = new Service<Void>() {
@Override
protected Task<Void> createTask() {
return new Task<Void>() {
@Override
protected Void call() throws Exception {
// Долгий код
return null;
}
};
}
};
service.start();
});
}
XmlMapper xmlMapper = new XmlMapper();
SomeClass obj = xmlMapper.readValue(xmlStr, SimpleBean.class);
JAXBContext jaxbContext = JAXBContext.newInstance(SomeClass.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
StreamSource source = new StreamSource(new StringReader(xmlStr));
JAXBElement<SomeClass> element = unmarshaller.unmarshal(source, SomeClass.class);
SomeClass someClass = element.getValue();