Enum? ?????? ??? ??? ????? ? ??? ? ??? ???? ? ?? ?????. ?? ??????? ???? ??? ???? ? ??? ? ? ????.
????
? ?? ??? ? ?????? ??? ???? ?? ?? ?? ? ??????? ?? ?? ?????.
Spring Boot 3.3.x? MongoDB? ???? ??? ?????.
?????? ??? ???? ? ? ??(??? ? ??)? ???? ?? ?? ??? ???? ?????.
public enum Type { EVENT("event"), ACTIVITY("activity"); private Type(String value) { this.value = value; } public String getValue() { return value; } }
??? Todo ??
public class Todo { private String id; private String name; private boolean completed; private Type type; ... ... }
?? ?????? ??? ???? ??? ?????.
- ?? ????? ???
- JSON ?? ??? ??? ???.
- MongoDB ??? ??? ???.
?? ??????? ???
? ??????? ??? ?? ????? ???? ? ??? ???? deserialize ???? ?????.
?? ??? ???? ?? ???? ???? ???? ?? ?? ???? ?? ??? ?? ????? ?????.
public Collection<Todo> read(@RequestParam(required = false) Type type) { ... ... }
?? ????? ?????? ?? ????? ??? ???? ???? ???.
?? ??? ???? enum ????? ??? ?? ???? Type.fromString? ???? ?? ?? ??????? ?????. fromString ???? ??? ?? ????? ?? ????.
public class StringToType implements Converter<String, Type> { @Override public Type convert(String source) { return Type.fromString(source); } }
??????? ???? ???? ???.
@Configuration public class Config implements WebMvcConfigurer { @Override public void addFormatters(FormatterRegistry registry) { registry.addConverter(new StringToType()); WebMvcConfigurer.super.addFormatters(registry); } }
?? Type? RequestParam?? ??? ? StringToType ???? ???? ???? ??? ?? ??? ???.
JSON ?? ??? ??? ???
JSON ?? ???? ???? ???? ???? ????? ??? ?? ???? ?? ??? ???? ???.
??? ???? ??? ??? ??? ????? @JsonValue ??? ???? ???.
?? ?? ??? ??? ?? ?? ???? ??? ?? ??? ???? ???? ???.
public enum Type { EVENT("event"), ACTIVITY("activity"); @JsonValue private String value; private static Map<String, Type> enumMap; private Type(String value) { this.value = value; } static { enumMap = Stream.of(values()).collect(Collectors.toMap(t -> t.value, t -> t)); } public static Type fromString(String value) { return enumMap.get(value); } public String getValue() { return value; } }
MongoDB ??? ??? Enum???.
MongoDB ???? ???? ???/????? ????? ??? ??? ?? PropertyValueConverter ???? ????? @ValueConverter ??? ???? ???.
???? Type ??? ??? ???? ?? ?? ? ?? ???? ???? MongoEnumConverter? ??????.
@Document(collection = "todo") @TypeAlias("todo") public class Todo { @Id private String id; private String name; private boolean completed; @ValueConverter(MongoEnumConverter.class) private Type type; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isCompleted() { return completed; } public void setCompleted(boolean completed) { this.completed = completed; } public Type getType() { return type; } public void setType(Type type) { this.type = type; } }
??? ?? ?? enum ????? Type.fromString? ???? ??? Type ????? ???? ????? ?????.
public enum Type { EVENT("event"), ACTIVITY("activity"); private Type(String value) { this.value = value; } public String getValue() { return value; } }
?????
? ????? ???? ? ?????? ??? ???? ???/????? ???? ? ?? ??? ??????. Spring? Jackson ?????? ? ??? ????? ? ?? ??? ?????.
??? Gitlab ????? ????? ?????.
? ?? ??? ??? CC0 ????? ????.
? ??? Spring Boot ? ???????? ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?? ?? ?? ??? ??? ?? ??? ??, ? ? ?? ? ??? ?????. 1. ??? ?? ???? ?? ???? ???-????, ? ??? ??? ??? ? ????, Hashmap? ???-??? ?? ??? ??? ???? ????. 2. NULL ? ?? ???? HashMap? ??? NULL ?? ?? ? ?? ???? ?? HashTable? NULL ?? ?? ???? ??? NullPointerException? ?????. 3. ????? ??? ????? ?? ??? ?? ?? ? ????? HashTable? ? ??? ?? ?? ??? ????. ?? ConcurrenTashMap? ???? ?? ????.

Java? ?? ??? ??? ?? ??? ??? ?? ??? ??? ?? ??? ?? ?? ??? ???? ??? ?? ???? ?????. 1. ??? ???? ??? ?? ?? ? ???? ?? ??? ???? ?? ?? ??? ? ????. 2. ???? ?? ??? ???? ??? ?? ???? ?? ?? ??? ???????. 3. ?? ???? ?? ?? ?? ? ???? ???? ?? NULL ?? ??? ? ????. 4. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

JIT ????? ??? ???, ??? ?? ? ???, ?? ?? ? ???? ? ? ?? ?? ??? ? ?? ??? ?? ??? ??????. 1. ??? ???? ?? ?? ??? ??? ?? ?? ???? ??? ?? ?????. 2. ??? ?? ? ??? ?? ?? ? ??? ???? ?? ?? ???; 3. ?? ??? ??? ?? ??? ???? ???? ???? ? ?? ?? ??? ?????. 4. ?? ??? ?? ??? ??? ???? ???? ?? ? ??? ???? ?? ??? ?????.

???? ??? ??? Java?? ??? ?? ???? ??? ?? ? ? ??? ??? ???? ? ?????. ?? ???? ??? ??, ??? ?? ??? ?? ?? ??? ??? ????? ???? ????? ?????. ?? ??? ??? ??, ????? ? ??? ????, ?? ??? ??? ?????? ? ?? ? ?? ?????.

injava, thefinalkeywordpreventsavariable'svalue'svalueffrombeingchangedafterassignment, butitsbehaviordiffersforprimitivesandobjectreences.forprimitivevariables, asinfinalintmax_speed = 100; wherereassoncesanerror.forobjectref

??? ??? ?? ?? ??? ????? ? ???? ????? ???? ?? ???? ?? ???? ?????. ?? ??? ??? ????. ?? ?? ?? ??? ???? ???? ?? ?? ??? ??? ?? ?? ??? ??? ?????. ?? ??? ??? ????. ?? ??? ?? ??? ?? ?? ??? ?? ?? ??? ???? NewClass ()? ??? ?? ???? ????. ?? ??? ?? ??? ???? ?? ??? ?? ? ? ??? ?? ?? ??? ????? ????? ?????. ?? ??, ?? ?????? ?????, ??? ? ?? ????? ??? ?? ?????. ???? ?? ?? ??? ???? ?? ???? ?? ? ??? ???? ?? ??? ?? ?????? ?????. ???? ???? ??? ??, ?? ?? ? ?? ??? ????, ?? ?? ???? ?????.

??? ? ?? ??? ???? : ????? ?? ?. 1. int? ???? ???? ?? ?? ?? ? ??? ???? ?????. 2. ?? ? ???? (int) myDouble ??? ?? ?? ??? ?????. ?? ??? ??? ?? ??? ?? ??, ?? ?? ?? ???? ?? ??? ?? ???? ?? ?????. ???? ? ??? ??? ????. ?? ??? ??? ??? ??? ??? ?? ??? ??? ? ??? ?? ???? ??? ??? ??? ??? ? ??? ?? ??? ?? ??? ?? ?? ? ? ????. ?? ?? ??? ?? ??? ??? ??? ??? ? ??????.
