This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyComponent { | |
private MyOtherComponentImpl otherComponent = Registry.get("MyOtherComponent", this); | |
private MyThirdComponent thirdComponent = otherComponent.getFactory(Registry.get("config")); | |
public MyComponent performAction() | |
{ | |
if(otherComponent.isConditionOk()) | |
{ | |
innerAction(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Result<FileDto> getFromFile(File f) { | |
Result<FileDto> result = new Result<>(); | |
FileDto dto = new FileDto(); | |
dto.setName(f.getName()); | |
dto.setPath(f.getAbsolutePath()); | |
dto.setDirectory(f.isDirectory()); | |
dto.setSize(f.length()); | |
dto.setModifiedAt(f.lastModified()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Result<FileDto> getFromFile(File f) { | |
FileDto dto = new FileDto(); | |
Result<FileDto> result = new Result<>(dto); | |
result.apply(r -> r.setName(f.getName())); | |
result.apply(r -> r.setPath(f.getAbsolutePath())); | |
result.apply(r -> r.setDirectory(f.isDirectory())); | |
result.apply(r -> r.setSize(f.length())); | |
result.apply(r -> r.setModifiedAt(f.lastModified())); | |
result.apply(r -> { |
OlderNewer