我刚刚升级到Intellij构思14和Java 8,我也想到将我的项目升级到Java版本8,开始使用一些新功能.但是在正确配置Intellij以使用Java 8后,我仍然遇到了Lombok的问题.看起来Java 8和lombok之间存在冲突,因为现在我@Getter和@Setter注释不再起作用了.
lombok的版本是1.10.8.有什么建议?
我正在尝试使用 github statuses,但文档不够清楚
假设我的回购项目是https://github.com/politrons/proyectV
他们在文档中声称该帖子应该是
POST /repos/:owner/:repo/statuses/:sha
Run Code Online (Sandbox Code Playgroud)
带着身体
{
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!",
"context": "continuous-integration/jenkins"
}
Run Code Online (Sandbox Code Playgroud)
所以就我而言,我正在尝试
发布https://github.com/repos/politrons/proyectV/statuses/1
与身体
{
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!",
"context": "continuous-integration/jenkins"
}
Run Code Online (Sandbox Code Playgroud)
但是github返回404。
知道我做错了什么吗?一些关于这个的卷曲例子会很棒!!
编辑:
我在分支 Test-status 上创建了一个拉取请求,当我尝试时
curl -v -X GET "https://api.github.com/repos/politrons/proyectV/pulls/1"
Run Code Online (Sandbox Code Playgroud)
我收到了包含大量信息的 json。然后我获取标题的 sha 信息并发送此 POST 命令
curl --request POST --data '{"state": "success", "description": "It works!", "target_url": "http://localhost"}' https://api.github.com/repos/politrons/projectV/statuses/5f4927adcfdc238ba8f46442b737d8ab912cc6ee
Run Code Online (Sandbox Code Playgroud)
但后来我收到
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}
Run Code Online (Sandbox Code Playgroud) 早上好,
我正在尝试使用Query注释将正则表达式与Spring数据mongodb存储库相结合.我想要的是在我的mongo文档的一个字符串属性中搜索一个子字符串.我一直在寻找谷歌和这里,但我没有发现任何优雅,我想知道Spring数据是否有关于这个使用存储库的正式事项.
问候.
我一直在玩Java Flow操作系统,offer但在阅读完文档后做了我的测试我不明白.
在这里我的测试
@Test
public void offer() throws InterruptedException {
//Create Publisher for expected items Strings
SubmissionPublisher<String> publisher = new SubmissionPublisher<>();
//Register Subscriber
publisher.subscribe(new CustomSubscriber<>());
publisher.subscribe(new CustomSubscriber<>());
publisher.subscribe(new CustomSubscriber<>());
publisher.offer("item", (subscriber, value) -> false);
Thread.sleep(500);
}
Run Code Online (Sandbox Code Playgroud)
offer服务器接收一个要发出的项和一个BiPredicate函数,据我所知阅读文档,只有在谓词函数为true的情况下才会发出它.
Bur通过测试结果是
Subscription done:
Subscription done:
Subscription done:
Got : item --> onNext() callback
Got : item --> onNext() callback
Got : item --> onNext() callback
Run Code Online (Sandbox Code Playgroud)
结果没有变化,如果不是假,我返回true.
任何人都可以向我解释一下这个算子好一点.
我再次将RxJava与Java 9 Flow进行比较.我看到Flow默认是异步的,我想知道是否有办法让它同步运行.
有时我们只是想将它用于Nio而不是糖语法,并且具有更加同质的代码.
在RxJava中,默认情况下是同步的,您可以使用observerOn和subscribeOn在管道中异步运行它.
Flow中是否有任何运算符使其在主线程中运行?
问候.
我最近遇到了问题,因为我的依赖项已更新为使用netty 4.1,而Gatling已有一段时间没有更新,并且仍然只能在Netty 4.0上运行。
有人知道加特林可以创建类似的模拟和方案,以便在我的Maven生命周期中自动运行性能测试吗?
我遇到了一个KafkaStream问题,在某个时候将状态从 转移REBALANCING到PENDING_ERROR,但我从未见过发生这种情况的原因。
我已经实现了一个未捕获的错误处理程序,但它从未被调用。
static StreamsUncaughtExceptionHandler uncaughtExceptionHandler(final String streamIdentifier) {
return th -> {
logger.error("{} - Failed to catch exception in stream: {}", streamIdentifier, th.getMessage(), th);
return StreamsUncaughtExceptionHandler.StreamThreadExceptionResponse.REPLACE_THREAD;
};
}
Run Code Online (Sandbox Code Playgroud)
我还有一个监听状态变化的监听器,但它不能给出原因。
static KafkaStreams.StateListener stateListener(final String streamIdentifier) {
return (newState, oldState) -> logger.info("{} - Kafka Streams Correlation Changed State [{}] -> [{}]", streamIdentifier, oldState, newState);
}
Run Code Online (Sandbox Code Playgroud) 我已经定义了这个流:
public int sumNumbers(int[] numbers) {
return IntStream.of(numbers)
.filter(n -> n <= 1000)
.sum();
}
Run Code Online (Sandbox Code Playgroud)
我总结了不高于1000的所有整数.但是现在我想做的是,如果数组的任何元素是负数,则抛出异常.
我知道如何做到这一点的老式的方式,但我想知道是否有任何机制Stream,并.filter()在那里我可以定义该过滤器的过滤器和异常情况
只是为了澄清我想抛出异常,而不像其他问题那样控制运行时异常.
这里的想法是,如果我的过滤器是真的:
filter(n -> n < 0 throw Exception)
Run Code Online (Sandbox Code Playgroud) 我在玩 Spring reactor,我看不出concat和mergeoperator之间有什么区别
这是我的例子
@Test
public void merge() {
Flux<String> flux1 = Flux.just("hello").doOnNext(value -> {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
Flux<String> flux2 = Flux.just("reactive").doOnNext(value -> {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
Flux<String> flux3 = Flux.just("world");
Flux.merge(flux1, flux2, flux3)
.map(String::toUpperCase)
.subscribe(System.out::println);
}
@Test
public void concat() {
Flux<String> flux1 = Flux.just("hello").doOnNext(value -> {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
Flux<String> …Run Code Online (Sandbox Code Playgroud) 为什么使用数据类型时我不能为这些数据属性提供相同的内部属性名称?
val这里我不能在多个Data中重用变量名
不编译
data Product = Product {val::String}deriving (Show, Eq)
data Price = Price {val::Double}deriving (Show, Eq)
data Discount = Discount { val::Double }deriving (Show, Eq)
Run Code Online (Sandbox Code Playgroud)
编译
data Product = Product {productVal::String}deriving (Show, Eq)
data Price = Price {priceVal::Double}deriving (Show, Eq)
data Discount = Discount { discountVal::Double }deriving (Show, Eq)
Run Code Online (Sandbox Code Playgroud) java ×7
spring ×3
java-8 ×2
java-9 ×2
java-flow ×2
apache-kafka ×1
flux ×1
gatling ×1
git ×1
github ×1
github-api ×1
haskell ×1
java-stream ×1
jenkins ×1
lombok ×1
mongodb ×1
reactor ×1
scala ×1
spring-data ×1