blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7332efd1fc6ad3b5e8a6df7b997f45dadbbaa00f | 2,765,959,005,329 | 8f805d9ac6829c1948b10a2b07174522aadd95b0 | /Implementation/src/groove/grammar/host/DefaultHostEdge.java | 6ec070242501db1141bc94fae40f9ffa38680f8c | []
| no_license | utwente-fmt/GROOVE-Unfolding | https://github.com/utwente-fmt/GROOVE-Unfolding | 13576adea4aea6e2929931badfcb1a147164e361 | ed67a3d0804e72dc7e99e14919cd3c7ee3652dbf | refs/heads/master | 2021-01-10T02:04:14.059000 | 2016-03-23T09:16:07 | 2016-03-23T09:16:07 | 54,131,212 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /* GROOVE: GRaphs for Object Oriented VErification
* Copyright 2003--2007 University of Twente
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
* $Id: DefaultHostEdge.java 5764 2015-12-14 22:07:04Z rensink $
*/
package groove.grammar.host;
import java.util.LinkedHashSet;
import java.util.Set;
import groove.grammar.AnchorKind;
import groove.grammar.type.TypeEdge;
import groove.grammar.type.TypeLabel;
import groove.graph.AEdge;
import groove.transform.Proof;
import groove.unfolding.prefix.EnrichedCondition;
import groove.unfolding.prefix.History;
/**
* Class that implements the edges of a host graph.
* @author Arend Rensink
*/
public class DefaultHostEdge extends AEdge<HostNode,TypeLabel> implements HostEdge {
/** Constructor for a typed edge.
* @param simple indicates if this is a simple or multi-edge.
*/
protected DefaultHostEdge(HostNode source, TypeEdge type, HostNode target, int nr,
boolean simple) {
super(source, type.label(), target, nr);
this.type = type;
this.simple = simple;
assert type != null;
}
// ------------------------------------------------------------------------
// Overridden methods
// ------------------------------------------------------------------------
@Override
public boolean isSimple() {
return this.simple;
}
@Override
protected boolean isTypeEqual(Object obj) {
return obj instanceof DefaultHostEdge;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
DefaultHostEdge other = (DefaultHostEdge) obj;
if (getType() != other.getType()) {
return false;
}
return true;
}
@Override
public TypeEdge getType() {
return this.type;
}
@Override
public AnchorKind getAnchorKind() {
return AnchorKind.EDGE;
}
/** Flag indicating whether this is a simple or multi-edge. */
private final boolean simple;
/** Non-{@code null} type of this edge. */
private final TypeEdge type;
/**********************************************
* This File has been Hijacked for Unfolding purposes defined below
**********************************************/
private Proof proof;
private boolean created = false;
public Proof getProof() {
return this.proof;
}
public void setProof(Proof proof) {
this.proof = proof;
}
public boolean isCreated() {
return this.created;
}
public void setCreated(boolean created) {
this.created = created;
}
//--------------------------------------
private Set<EnrichedCondition> generationHistories = new LinkedHashSet<EnrichedCondition>();
private Set<EnrichedCondition> readingHistories = new LinkedHashSet<EnrichedCondition>();
public Set<EnrichedCondition> getGenerationHistories() {
return generationHistories;
}
public void addGenerationHistory(EnrichedCondition genHistory) {
this.generationHistories.add(genHistory);
}
public Set<EnrichedCondition> getReadingHistories() {
return readingHistories;
}
public void addReadingHistories(EnrichedCondition readingHistory) {
this.readingHistories.add(readingHistory);
}
}
| UTF-8 | Java | 3,890 | java | DefaultHostEdge.java | Java | [
{
"context": "t implements the edges of a host graph.\n * @author Arend Rensink\n */\npublic class DefaultHostEdge extends AEdge<Ho",
"end": 1142,
"score": 0.9998367428779602,
"start": 1129,
"tag": "NAME",
"value": "Arend Rensink"
}
]
| null | []
| /* GROOVE: GRaphs for Object Oriented VErification
* Copyright 2003--2007 University of Twente
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
* $Id: DefaultHostEdge.java 5764 2015-12-14 22:07:04Z rensink $
*/
package groove.grammar.host;
import java.util.LinkedHashSet;
import java.util.Set;
import groove.grammar.AnchorKind;
import groove.grammar.type.TypeEdge;
import groove.grammar.type.TypeLabel;
import groove.graph.AEdge;
import groove.transform.Proof;
import groove.unfolding.prefix.EnrichedCondition;
import groove.unfolding.prefix.History;
/**
* Class that implements the edges of a host graph.
* @author <NAME>
*/
public class DefaultHostEdge extends AEdge<HostNode,TypeLabel> implements HostEdge {
/** Constructor for a typed edge.
* @param simple indicates if this is a simple or multi-edge.
*/
protected DefaultHostEdge(HostNode source, TypeEdge type, HostNode target, int nr,
boolean simple) {
super(source, type.label(), target, nr);
this.type = type;
this.simple = simple;
assert type != null;
}
// ------------------------------------------------------------------------
// Overridden methods
// ------------------------------------------------------------------------
@Override
public boolean isSimple() {
return this.simple;
}
@Override
protected boolean isTypeEqual(Object obj) {
return obj instanceof DefaultHostEdge;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
DefaultHostEdge other = (DefaultHostEdge) obj;
if (getType() != other.getType()) {
return false;
}
return true;
}
@Override
public TypeEdge getType() {
return this.type;
}
@Override
public AnchorKind getAnchorKind() {
return AnchorKind.EDGE;
}
/** Flag indicating whether this is a simple or multi-edge. */
private final boolean simple;
/** Non-{@code null} type of this edge. */
private final TypeEdge type;
/**********************************************
* This File has been Hijacked for Unfolding purposes defined below
**********************************************/
private Proof proof;
private boolean created = false;
public Proof getProof() {
return this.proof;
}
public void setProof(Proof proof) {
this.proof = proof;
}
public boolean isCreated() {
return this.created;
}
public void setCreated(boolean created) {
this.created = created;
}
//--------------------------------------
private Set<EnrichedCondition> generationHistories = new LinkedHashSet<EnrichedCondition>();
private Set<EnrichedCondition> readingHistories = new LinkedHashSet<EnrichedCondition>();
public Set<EnrichedCondition> getGenerationHistories() {
return generationHistories;
}
public void addGenerationHistory(EnrichedCondition genHistory) {
this.generationHistories.add(genHistory);
}
public Set<EnrichedCondition> getReadingHistories() {
return readingHistories;
}
public void addReadingHistories(EnrichedCondition readingHistory) {
this.readingHistories.add(readingHistory);
}
}
| 3,883 | 0.629306 | 0.621594 | 135 | 27.814816 | 24.514603 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.488889 | false | false | 0 |
b4505d50f69c7ef0b7c72d5562ac46d2dc885239 | 515,396,100,377 | b9ecfcf637258148ade5c3edad5cccf2c88b658c | /InsertionSort.java | ac42b658d08b91ebbb3c2ca2e76a3b626a2cdb06 | []
| no_license | USF-CS245-09-2018/practice-assignment-04-tjwong | https://github.com/USF-CS245-09-2018/practice-assignment-04-tjwong | d47c1a4d93cb20c025f239217a13dd4957671019 | 0969a8a62d9f1c42734e4274a7c7c8858494f108 | refs/heads/master | 2020-03-29T11:13:41.134000 | 2018-09-22T06:47:08 | 2018-09-22T06:47:08 | 149,842,293 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | public class InsertionSort implements SortingAlgorithm{
private double[] arr = new double[];
void insertionSort(double[] arr){
for(int i = 1; i < arr.length - 1; i++){
double temp = arr[i];
int k = i - 1;
while( k > 0 && arr[k] > temp){
arr[k+1] = arr[k];
--k;
}
arr[k+1] = temp;
}
}
@Override
public void sort(int[] a) {
}
}
| UTF-8 | Java | 463 | java | InsertionSort.java | Java | []
| null | []
| public class InsertionSort implements SortingAlgorithm{
private double[] arr = new double[];
void insertionSort(double[] arr){
for(int i = 1; i < arr.length - 1; i++){
double temp = arr[i];
int k = i - 1;
while( k > 0 && arr[k] > temp){
arr[k+1] = arr[k];
--k;
}
arr[k+1] = temp;
}
}
@Override
public void sort(int[] a) {
}
}
| 463 | 0.434125 | 0.421166 | 22 | 20.045454 | 17.636423 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false | 0 |
a43d0a76a3b4b448ef51d89d35cd7fdd02c2558d | 2,585,570,324,315 | 6937ac27acf499be90a70a84fb20d3948ea2265d | /src/main/java/net/citrite/pip/sfdc/Request.java | 01273f560489026f30a5f70ea947fb75f7124589 | []
| no_license | mauriziocarioli/Policy-POC | https://github.com/mauriziocarioli/Policy-POC | bb010b966a3f4a7bf3d7fa735d3181b4ff99b8a2 | a708e560ffb4df8a99b022c21df30db010ca26bf | refs/heads/master | 2020-05-09T10:20:22.930000 | 2019-04-14T00:35:51 | 2019-04-14T00:35:51 | 181,037,909 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.citrite.pip.sfdc;
import java.io.Serializable;
import java.util.List;
import net.citrite.pip.salesforce.Specialization;
import net.citrite.pip.salesforce.AuthorizationItem;
public class Request implements Serializable {
private static final long serialVersionUID = -1524280697031891812L;
@org.kie.api.definition.type.Label(value = "Order")
private Order Order;
@org.kie.api.definition.type.Label(value = "Reward Registration")
private RewardRegistration RewardRegistration;
@org.kie.api.definition.type.Label(value = "Partner Info")
private PartnerInfo PartnerInfo;
@org.kie.api.definition.type.Label(value = "Partner Functions")
private PartnerFunctions PartnerFunctions;
@org.kie.api.definition.type.Label(value = "Original Order")
private OriginalOrder OriginalOrder;
@org.kie.api.definition.type.Label(value = "Sales Exceptions")
private List<String> SalesExceptions;
@org.kie.api.definition.type.Label(value = "Product Authorizations")
private List<AuthorizationItem> ProductAuthorizations;
@org.kie.api.definition.type.Label(value = "End User Info")
private EndUserInfo EndUserInfo;
@org.kie.api.definition.type.Label(value = "Specializations")
private List<Specialization> Specializations;
public Order getOrder() {
return this.Order;
}
public void setOrder(Order Order) {
this.Order = Order;
}
public RewardRegistration getRewardRegistration() {
return this.RewardRegistration;
}
public void setRewardRegistration(RewardRegistration RewardRegistration) {
this.RewardRegistration = RewardRegistration;
}
public PartnerInfo getPartnerInfo() {
return this.PartnerInfo;
}
public void setPartnerInfo(PartnerInfo PartnerInfo) {
this.PartnerInfo = PartnerInfo;
}
public PartnerFunctions getPartnerFunctions() {
return this.PartnerFunctions;
}
public void setPartnerFunctions(PartnerFunctions PartnerFunctions) {
this.PartnerFunctions = PartnerFunctions;
}
public OriginalOrder getOriginalOrder() {
return this.OriginalOrder;
}
public void setOriginalOrder(OriginalOrder OriginalOrder) {
this.OriginalOrder = OriginalOrder;
}
public List<String> getSalesExceptions() {
return this.SalesExceptions;
}
public void setSalesExceptions(List<String> SalesExceptions) {
this.SalesExceptions = SalesExceptions;
}
public List<AuthorizationItem> getProductAuthorizations() {
return this.ProductAuthorizations;
}
public void setProductAuthorizations(List<AuthorizationItem> ProductAuthorizations) {
this.ProductAuthorizations = ProductAuthorizations;
}
public EndUserInfo getEndUserInfo() {
return this.EndUserInfo;
}
public void setEndUserInfo(EndUserInfo EndUserInfo) {
this.EndUserInfo = EndUserInfo;
}
public List<Specialization> getSpecializations() {
return this.Specializations;
}
public void setSpecializations(List<Specialization> Specializations) {
this.Specializations = Specializations;
}
public Request(Order Order, RewardRegistration RewardRegistration, PartnerInfo PartnerInfo, PartnerFunctions PartnerFunctions, OriginalOrder OriginalOrder, List<String> SalesExceptions, List<AuthorizationItem> ProductAuthorizations, EndUserInfo EndUserInfo, List<Specialization> Specializations) {
this.Order = Order;
this.RewardRegistration = RewardRegistration;
this.PartnerInfo = PartnerInfo;
this.PartnerFunctions = PartnerFunctions;
this.OriginalOrder = OriginalOrder;
this.SalesExceptions = SalesExceptions;
this.ProductAuthorizations = ProductAuthorizations;
this.EndUserInfo = EndUserInfo;
this.Specializations = Specializations;
}
public Request() {
}
}
| UTF-8 | Java | 3,604 | java | Request.java | Java | []
| null | []
| package net.citrite.pip.sfdc;
import java.io.Serializable;
import java.util.List;
import net.citrite.pip.salesforce.Specialization;
import net.citrite.pip.salesforce.AuthorizationItem;
public class Request implements Serializable {
private static final long serialVersionUID = -1524280697031891812L;
@org.kie.api.definition.type.Label(value = "Order")
private Order Order;
@org.kie.api.definition.type.Label(value = "Reward Registration")
private RewardRegistration RewardRegistration;
@org.kie.api.definition.type.Label(value = "Partner Info")
private PartnerInfo PartnerInfo;
@org.kie.api.definition.type.Label(value = "Partner Functions")
private PartnerFunctions PartnerFunctions;
@org.kie.api.definition.type.Label(value = "Original Order")
private OriginalOrder OriginalOrder;
@org.kie.api.definition.type.Label(value = "Sales Exceptions")
private List<String> SalesExceptions;
@org.kie.api.definition.type.Label(value = "Product Authorizations")
private List<AuthorizationItem> ProductAuthorizations;
@org.kie.api.definition.type.Label(value = "End User Info")
private EndUserInfo EndUserInfo;
@org.kie.api.definition.type.Label(value = "Specializations")
private List<Specialization> Specializations;
public Order getOrder() {
return this.Order;
}
public void setOrder(Order Order) {
this.Order = Order;
}
public RewardRegistration getRewardRegistration() {
return this.RewardRegistration;
}
public void setRewardRegistration(RewardRegistration RewardRegistration) {
this.RewardRegistration = RewardRegistration;
}
public PartnerInfo getPartnerInfo() {
return this.PartnerInfo;
}
public void setPartnerInfo(PartnerInfo PartnerInfo) {
this.PartnerInfo = PartnerInfo;
}
public PartnerFunctions getPartnerFunctions() {
return this.PartnerFunctions;
}
public void setPartnerFunctions(PartnerFunctions PartnerFunctions) {
this.PartnerFunctions = PartnerFunctions;
}
public OriginalOrder getOriginalOrder() {
return this.OriginalOrder;
}
public void setOriginalOrder(OriginalOrder OriginalOrder) {
this.OriginalOrder = OriginalOrder;
}
public List<String> getSalesExceptions() {
return this.SalesExceptions;
}
public void setSalesExceptions(List<String> SalesExceptions) {
this.SalesExceptions = SalesExceptions;
}
public List<AuthorizationItem> getProductAuthorizations() {
return this.ProductAuthorizations;
}
public void setProductAuthorizations(List<AuthorizationItem> ProductAuthorizations) {
this.ProductAuthorizations = ProductAuthorizations;
}
public EndUserInfo getEndUserInfo() {
return this.EndUserInfo;
}
public void setEndUserInfo(EndUserInfo EndUserInfo) {
this.EndUserInfo = EndUserInfo;
}
public List<Specialization> getSpecializations() {
return this.Specializations;
}
public void setSpecializations(List<Specialization> Specializations) {
this.Specializations = Specializations;
}
public Request(Order Order, RewardRegistration RewardRegistration, PartnerInfo PartnerInfo, PartnerFunctions PartnerFunctions, OriginalOrder OriginalOrder, List<String> SalesExceptions, List<AuthorizationItem> ProductAuthorizations, EndUserInfo EndUserInfo, List<Specialization> Specializations) {
this.Order = Order;
this.RewardRegistration = RewardRegistration;
this.PartnerInfo = PartnerInfo;
this.PartnerFunctions = PartnerFunctions;
this.OriginalOrder = OriginalOrder;
this.SalesExceptions = SalesExceptions;
this.ProductAuthorizations = ProductAuthorizations;
this.EndUserInfo = EndUserInfo;
this.Specializations = Specializations;
}
public Request() {
}
}
| 3,604 | 0.795228 | 0.789956 | 118 | 29.542374 | 34.616703 | 298 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.38983 | false | false | 0 |
2e4674c399b9b4db7dcf27fd7debbdb602d3a8b1 | 2,585,570,322,117 | 6775678d017086bb5a5b23108e645264e743f8a5 | /src/main/java/com/linux/oauth2/configuration/RestTemplateConfig.java | d6c889cb05fecc2b7f7d7c9b6bbeec9f1eea8a3e | []
| no_license | huhx/oauth2-in-action | https://github.com/huhx/oauth2-in-action | 3f6084abf2876510368a7ae8d23825a23fb87bff | a23957e409ab1ea2859629de0564a0848c964377 | refs/heads/master | 2021-04-07T18:42:17.264000 | 2020-03-20T07:54:24 | 2020-03-20T07:54:24 | 248,698,204 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.linux.oauth2.configuration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
import org.springframework.web.client.RestTemplate;
@Configuration
public class RestTemplateConfig {
@Bean("oAuth2RestTemplate")
public OAuth2RestTemplate buildOAuth2RestTemplate(ClientCredentialsResourceDetails clientCredentialsResourceDetails) {
return new OAuth2RestTemplate(clientCredentialsResourceDetails);
}
@Bean("restTemplate")
public RestTemplate buildTemplate(RestTemplateBuilder builder) {
return builder.build();
}
@Bean
@ConfigurationProperties(prefix = "security.oauth2.client")
public ClientCredentialsResourceDetails clientCredentialsResourceDetails() {
return new ClientCredentialsResourceDetails();
}
}
| UTF-8 | Java | 1,125 | java | RestTemplateConfig.java | Java | []
| null | []
| package com.linux.oauth2.configuration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
import org.springframework.web.client.RestTemplate;
@Configuration
public class RestTemplateConfig {
@Bean("oAuth2RestTemplate")
public OAuth2RestTemplate buildOAuth2RestTemplate(ClientCredentialsResourceDetails clientCredentialsResourceDetails) {
return new OAuth2RestTemplate(clientCredentialsResourceDetails);
}
@Bean("restTemplate")
public RestTemplate buildTemplate(RestTemplateBuilder builder) {
return builder.build();
}
@Bean
@ConfigurationProperties(prefix = "security.oauth2.client")
public ClientCredentialsResourceDetails clientCredentialsResourceDetails() {
return new ClientCredentialsResourceDetails();
}
}
| 1,125 | 0.84 | 0.832 | 29 | 37.793102 | 33.634319 | 120 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.37931 | false | false | 0 |
02800b9e00fc1a4f5dcd9502607ef9934b8cc4ed | 14,516,989,505,218 | c4f4d65cc67124486aa479d39088768ea7267c46 | /src/it/coduric/dama/campo/Casella.java | 25e835a8cb49fe1b352cc1cd786995fef954cb16 | []
| no_license | coduri/JDama | https://github.com/coduri/JDama | 8020fc301ffd870d39ad5b8cd930048e19ca9282 | 9723d08a4b99ca94b2113ca7f5b2caac3e28fb6e | refs/heads/main | 2023-02-25T13:42:59.048000 | 2021-02-04T17:14:53 | 2021-02-04T17:14:53 | 335,787,436 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package it.coduric.dama.campo;
import it.coduric.dama.model.pezzi.Pezzo;
/**
* Questa classe rappresenta una casella del campo di gioco, la casella è all'interno di una matrice e ha una sua
* riga e colonna di appartenenza e può contenere o non contenere un pezzo. (Se non lo contiene p = null)
*/
public class Casella {
private int riga;
private int colonna;
private Pezzo p;
//Costruttore per inizializzare una casella (il pezzo verrà settato sempre attraverso setP())
public Casella(int riga, int colonna){
this.riga = riga;
this.colonna = colonna;
this.p = null;
}
//metodo che indica se nella casella c'è un pezzo o no
public boolean isTherePezzo() {
return p != null; //se p != null dico true
}
public Pezzo getPezzo() {
return p;
}
public int getRiga() {
return riga;
}
public int getColonna() {
return colonna;
}
public void setP(Pezzo p) {
this.p = p;
}
}
| UTF-8 | Java | 1,013 | java | Casella.java | Java | []
| null | []
| package it.coduric.dama.campo;
import it.coduric.dama.model.pezzi.Pezzo;
/**
* Questa classe rappresenta una casella del campo di gioco, la casella è all'interno di una matrice e ha una sua
* riga e colonna di appartenenza e può contenere o non contenere un pezzo. (Se non lo contiene p = null)
*/
public class Casella {
private int riga;
private int colonna;
private Pezzo p;
//Costruttore per inizializzare una casella (il pezzo verrà settato sempre attraverso setP())
public Casella(int riga, int colonna){
this.riga = riga;
this.colonna = colonna;
this.p = null;
}
//metodo che indica se nella casella c'è un pezzo o no
public boolean isTherePezzo() {
return p != null; //se p != null dico true
}
public Pezzo getPezzo() {
return p;
}
public int getRiga() {
return riga;
}
public int getColonna() {
return colonna;
}
public void setP(Pezzo p) {
this.p = p;
}
}
| 1,013 | 0.630327 | 0.630327 | 43 | 22.465117 | 27.266428 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.348837 | false | false | 0 |
364880f61537d04f974d63adcd18631691b3cfa5 | 15,290,083,615,097 | cb484fd3f9767ff48af849cc8fa1511e787fe16c | /src/main/java/com/ternnetwork/baseframework/dao/impl/security/RescRoleDaoImpl.java | d2c38144b11cfd004608240cd5baf10fc7065215 | []
| no_license | cnywb/ocms | https://github.com/cnywb/ocms | ee84439390d7f5c2d6d83e09fc81ab6d48e0ca6a | 31f65b0b1b14f2b709007705313cec259bf6b823 | refs/heads/master | 2020-04-08T02:26:24.952000 | 2018-11-24T13:20:48 | 2018-11-24T13:20:48 | 158,935,851 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ternnetwork.baseframework.dao.impl.security;
import org.springframework.stereotype.Repository;
import com.ternnetwork.baseframework.dao.impl.base.IBaseDaoImpl;
import com.ternnetwork.baseframework.dao.security.RescRoleDao;
import com.ternnetwork.baseframework.model.security.RescRole;
@Repository("rescRoleDao")
public class RescRoleDaoImpl extends IBaseDaoImpl<RescRole> implements
RescRoleDao {
}
| UTF-8 | Java | 434 | java | RescRoleDaoImpl.java | Java | []
| null | []
| package com.ternnetwork.baseframework.dao.impl.security;
import org.springframework.stereotype.Repository;
import com.ternnetwork.baseframework.dao.impl.base.IBaseDaoImpl;
import com.ternnetwork.baseframework.dao.security.RescRoleDao;
import com.ternnetwork.baseframework.model.security.RescRole;
@Repository("rescRoleDao")
public class RescRoleDaoImpl extends IBaseDaoImpl<RescRole> implements
RescRoleDao {
}
| 434 | 0.813364 | 0.813364 | 15 | 26.933332 | 28.424089 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.466667 | false | false | 0 |
af1ee8a8fc9a0f5b5ecf56cbfe41a1f9ae7b0ef0 | 9,345,848,872,434 | d3a4fe06f36fd0cab86560b025a1b48f1fe71e80 | /src/iddfs/Node.java | 8c6b32df6b58d65cb6285a0d72a1ec7b042c3e0b | []
| no_license | jhonieldor/graph_algorithms | https://github.com/jhonieldor/graph_algorithms | 6832a8eedf39914f5f66d93b90bdc0d33572f7aa | 44d223dccae8b02a9d79fa42b5b8493d1061539f | refs/heads/master | 2020-12-31T00:02:20.804000 | 2017-02-01T02:12:02 | 2017-02-01T02:12:02 | 80,570,307 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package iddfs;
import java.util.ArrayList;
import java.util.List;
/**
* Created by jhoni on 31/01/2017.
*/
public class Node {
private String name;
private Integer depthLevel = 0;
private List<Node> adjanciesList;
public Node(String name) {
this.name = name;
this.adjanciesList = new ArrayList<>();
}
public void addNeighbour(Node node){
this.adjanciesList.add(node);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDepthLevel() {
return depthLevel;
}
public void setDepthLevel(Integer depthLevel) {
this.depthLevel = depthLevel;
}
public List<Node> getAdjanciesList() {
return adjanciesList;
}
public void setAdjanciesList(List<Node> adjanciesList) {
this.adjanciesList = adjanciesList;
}
@Override
public String toString() {
return "Node{" +
"name='" + name + '\'' +
'}';
}
}
| UTF-8 | Java | 1,060 | java | Node.java | Java | [
{
"context": "rayList;\nimport java.util.List;\n\n/**\n * Created by jhoni on 31/01/2017.\n */\npublic class Node {\n\n priva",
"end": 91,
"score": 0.99930739402771,
"start": 86,
"tag": "USERNAME",
"value": "jhoni"
}
]
| null | []
| package iddfs;
import java.util.ArrayList;
import java.util.List;
/**
* Created by jhoni on 31/01/2017.
*/
public class Node {
private String name;
private Integer depthLevel = 0;
private List<Node> adjanciesList;
public Node(String name) {
this.name = name;
this.adjanciesList = new ArrayList<>();
}
public void addNeighbour(Node node){
this.adjanciesList.add(node);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDepthLevel() {
return depthLevel;
}
public void setDepthLevel(Integer depthLevel) {
this.depthLevel = depthLevel;
}
public List<Node> getAdjanciesList() {
return adjanciesList;
}
public void setAdjanciesList(List<Node> adjanciesList) {
this.adjanciesList = adjanciesList;
}
@Override
public String toString() {
return "Node{" +
"name='" + name + '\'' +
'}';
}
}
| 1,060 | 0.587736 | 0.579245 | 54 | 18.629629 | 16.80641 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.296296 | false | false | 0 |
8b35f290f3dc1de83c995d5b03ecefb8b5d8111a | 18,451,179,514,521 | 1c476d7316441ac7287f783f52450d211aa61d48 | /src/intro_to_file_io/Question4.java | 751db3bd4aebf138e7ef6f233c6c1e5c7e018ca8 | []
| no_license | NY-Giants/L3_Module_2 | https://github.com/NY-Giants/L3_Module_2 | 0cba7e8bd7fee8c362d1ad46c60e9e26a7ea05ab | 0219c29a9f26ce4a053b82fba8f3299fdf1d051f | refs/heads/master | 2021-05-06T19:25:57.807000 | 2018-01-04T03:42:26 | 2018-01-04T03:42:26 | 112,129,510 | 0 | 0 | null | true | 2017-11-27T00:50:41 | 2017-11-27T00:50:40 | 2017-08-28T17:42:12 | 2017-08-30T19:28:47 | 5 | 0 | 0 | 0 | null | false | null | package intro_to_file_io;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
public class Question4 implements ActionListener {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JButton b1 = new JButton("Add Task");
JButton b2 = new JButton("Remove Task");
JButton b3 = new JButton("Save");
JButton b4 = new JButton("Load");
static String at;
static String rt;
ArrayList<String> TaskList = new ArrayList<String>();
public static void main(String[] args) {
Question4 q4 = new Question4();
}
Question4(){
frame.setSize(800,800);
frame.add(panel);
panel.add(b1);
panel.add(b2);
panel.add(b3);
panel.add(b4);
frame.setVisible(true);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
TaskList.add(at);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==b1) {
at = JOptionPane.showInputDialog("Which Task Would you Like to Add?");
TaskList.add(at);
}
if(e.getSource()==b2) {
rt = JOptionPane.showInputDialog("Which Task Would you Like to Remove?");
for(int i = 0; i < TaskList.size(); i++) {
if(TaskList.get(i).equals(rt)) {
TaskList.remove(rt);
}
}
}
if(e.getSource()==b3) {
try {
JOptionPane.showMessageDialog(b3, "Saving Task(s)");
FileWriter fw = new FileWriter("src/intro_to_file_io/test2.txt", true);
for(int i = 0; i < TaskList.size(); i++) {
fw.write(at +"\n");
}
fw.close();
} catch (IOException e3) {
e3.printStackTrace();
}
}
if(e.getSource()==b4) {
try {
JOptionPane.showMessageDialog(b3, "Loading Tasks...");
BufferedReader br = new BufferedReader(new FileReader("src/intro_to_file_io/test2.txt"));
String line = br.readLine();
TaskList.add(line);
br.close();
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}
}
}
| UTF-8 | Java | 2,338 | java | Question4.java | Java | []
| null | []
| package intro_to_file_io;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
public class Question4 implements ActionListener {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JButton b1 = new JButton("Add Task");
JButton b2 = new JButton("Remove Task");
JButton b3 = new JButton("Save");
JButton b4 = new JButton("Load");
static String at;
static String rt;
ArrayList<String> TaskList = new ArrayList<String>();
public static void main(String[] args) {
Question4 q4 = new Question4();
}
Question4(){
frame.setSize(800,800);
frame.add(panel);
panel.add(b1);
panel.add(b2);
panel.add(b3);
panel.add(b4);
frame.setVisible(true);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
TaskList.add(at);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==b1) {
at = JOptionPane.showInputDialog("Which Task Would you Like to Add?");
TaskList.add(at);
}
if(e.getSource()==b2) {
rt = JOptionPane.showInputDialog("Which Task Would you Like to Remove?");
for(int i = 0; i < TaskList.size(); i++) {
if(TaskList.get(i).equals(rt)) {
TaskList.remove(rt);
}
}
}
if(e.getSource()==b3) {
try {
JOptionPane.showMessageDialog(b3, "Saving Task(s)");
FileWriter fw = new FileWriter("src/intro_to_file_io/test2.txt", true);
for(int i = 0; i < TaskList.size(); i++) {
fw.write(at +"\n");
}
fw.close();
} catch (IOException e3) {
e3.printStackTrace();
}
}
if(e.getSource()==b4) {
try {
JOptionPane.showMessageDialog(b3, "Loading Tasks...");
BufferedReader br = new BufferedReader(new FileReader("src/intro_to_file_io/test2.txt"));
String line = br.readLine();
TaskList.add(line);
br.close();
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}
}
}
| 2,338 | 0.676647 | 0.659966 | 96 | 23.354166 | 18.743876 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.239583 | false | false | 0 |
ffe07e2aedc3ca22157e592c44fd05f54a31a37a | 5,755,256,183,225 | 19eb5d33055be826c0a493f0a3e513927a272b31 | /phone-order/src/main/java/es/masmovil/phoneorder/repository/OrderRepository.java | 7f25819138577f7c92b8486ffafc55df68eb94d5 | []
| no_license | InCornito/phone-app | https://github.com/InCornito/phone-app | dbbc13686fb261b4ee9523cb986754c1c5f9ce0f | 88dd54b3340c87fc009a0e53053b37391c95a4ef | refs/heads/master | 2020-04-01T18:29:06.093000 | 2018-10-17T18:44:19 | 2018-10-17T18:44:19 | 153,495,242 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package es.masmovil.phoneorder.repository;
import es.masmovil.phoneorder.entity.Order;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
public interface OrderRepository extends ReactiveMongoRepository<Order, String> {
}
| UTF-8 | Java | 251 | java | OrderRepository.java | Java | []
| null | []
| package es.masmovil.phoneorder.repository;
import es.masmovil.phoneorder.entity.Order;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
public interface OrderRepository extends ReactiveMongoRepository<Order, String> {
}
| 251 | 0.848606 | 0.848606 | 9 | 26.888889 | 32.133209 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 0 |
d7a308149712a31e4f4bdc096a92f7144dbbd3ee | 17,033,840,338,976 | e19588bde506681ce5b33d452a1fb4a50a418838 | /eshop/src/main/java/online/shixun/demo/eshop/dto/EshopUserCriteria.java | 69b3078765bb80b643c2336a3a444d856579710d | []
| no_license | yuanyixiong/SpringBoot | https://github.com/yuanyixiong/SpringBoot | 6b3cfc133804dc7e825a70e4bc66d6fc8e622881 | aebedba43bde57d6f4d34e53e845f849f1aeee0c | refs/heads/master | 2020-03-21T04:51:38.419000 | 2018-06-21T06:50:39 | 2018-06-21T06:50:59 | 138,130,982 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package online.shixun.demo.eshop.dto;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class EshopUserCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public EshopUserCriteria() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIsDelIsNull() {
addCriterion("is_del is null");
return (Criteria) this;
}
public Criteria andIsDelIsNotNull() {
addCriterion("is_del is not null");
return (Criteria) this;
}
public Criteria andIsDelEqualTo(Integer value) {
addCriterion("is_del =", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotEqualTo(Integer value) {
addCriterion("is_del <>", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThan(Integer value) {
addCriterion("is_del >", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThanOrEqualTo(Integer value) {
addCriterion("is_del >=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThan(Integer value) {
addCriterion("is_del <", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThanOrEqualTo(Integer value) {
addCriterion("is_del <=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelIn(List<Integer> values) {
addCriterion("is_del in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotIn(List<Integer> values) {
addCriterion("is_del not in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelBetween(Integer value1, Integer value2) {
addCriterion("is_del between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotBetween(Integer value1, Integer value2) {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterionForJDBCDate("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterionForJDBCDate("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterionForJDBCDate("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterionForJDBCDate("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterionForJDBCDate("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterionForJDBCDate("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterionForJDBCDate("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterionForJDBCDate("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUserEmailIsNull() {
addCriterion("user_email is null");
return (Criteria) this;
}
public Criteria andUserEmailIsNotNull() {
addCriterion("user_email is not null");
return (Criteria) this;
}
public Criteria andUserEmailEqualTo(String value) {
addCriterion("user_email =", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotEqualTo(String value) {
addCriterion("user_email <>", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailGreaterThan(String value) {
addCriterion("user_email >", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailGreaterThanOrEqualTo(String value) {
addCriterion("user_email >=", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailLessThan(String value) {
addCriterion("user_email <", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailLessThanOrEqualTo(String value) {
addCriterion("user_email <=", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailLike(String value) {
addCriterion("user_email like", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotLike(String value) {
addCriterion("user_email not like", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailIn(List<String> values) {
addCriterion("user_email in", values, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotIn(List<String> values) {
addCriterion("user_email not in", values, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailBetween(String value1, String value2) {
addCriterion("user_email between", value1, value2, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotBetween(String value1, String value2) {
addCriterion("user_email not between", value1, value2, "userEmail");
return (Criteria) this;
}
public Criteria andUserLoginNameIsNull() {
addCriterion("user_login_name is null");
return (Criteria) this;
}
public Criteria andUserLoginNameIsNotNull() {
addCriterion("user_login_name is not null");
return (Criteria) this;
}
public Criteria andUserLoginNameEqualTo(String value) {
addCriterion("user_login_name =", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotEqualTo(String value) {
addCriterion("user_login_name <>", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameGreaterThan(String value) {
addCriterion("user_login_name >", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameGreaterThanOrEqualTo(String value) {
addCriterion("user_login_name >=", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameLessThan(String value) {
addCriterion("user_login_name <", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameLessThanOrEqualTo(String value) {
addCriterion("user_login_name <=", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameLike(String value) {
addCriterion("user_login_name like", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotLike(String value) {
addCriterion("user_login_name not like", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameIn(List<String> values) {
addCriterion("user_login_name in", values, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotIn(List<String> values) {
addCriterion("user_login_name not in", values, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameBetween(String value1, String value2) {
addCriterion("user_login_name between", value1, value2, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotBetween(String value1, String value2) {
addCriterion("user_login_name not between", value1, value2, "userLoginName");
return (Criteria) this;
}
public Criteria andUserNicakNameIsNull() {
addCriterion("user_nicak_name is null");
return (Criteria) this;
}
public Criteria andUserNicakNameIsNotNull() {
addCriterion("user_nicak_name is not null");
return (Criteria) this;
}
public Criteria andUserNicakNameEqualTo(String value) {
addCriterion("user_nicak_name =", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotEqualTo(String value) {
addCriterion("user_nicak_name <>", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameGreaterThan(String value) {
addCriterion("user_nicak_name >", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameGreaterThanOrEqualTo(String value) {
addCriterion("user_nicak_name >=", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameLessThan(String value) {
addCriterion("user_nicak_name <", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameLessThanOrEqualTo(String value) {
addCriterion("user_nicak_name <=", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameLike(String value) {
addCriterion("user_nicak_name like", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotLike(String value) {
addCriterion("user_nicak_name not like", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameIn(List<String> values) {
addCriterion("user_nicak_name in", values, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotIn(List<String> values) {
addCriterion("user_nicak_name not in", values, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameBetween(String value1, String value2) {
addCriterion("user_nicak_name between", value1, value2, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotBetween(String value1, String value2) {
addCriterion("user_nicak_name not between", value1, value2, "userNicakName");
return (Criteria) this;
}
public Criteria andUserPasswordIsNull() {
addCriterion("user_password is null");
return (Criteria) this;
}
public Criteria andUserPasswordIsNotNull() {
addCriterion("user_password is not null");
return (Criteria) this;
}
public Criteria andUserPasswordEqualTo(String value) {
addCriterion("user_password =", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotEqualTo(String value) {
addCriterion("user_password <>", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordGreaterThan(String value) {
addCriterion("user_password >", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordGreaterThanOrEqualTo(String value) {
addCriterion("user_password >=", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordLessThan(String value) {
addCriterion("user_password <", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordLessThanOrEqualTo(String value) {
addCriterion("user_password <=", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordLike(String value) {
addCriterion("user_password like", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotLike(String value) {
addCriterion("user_password not like", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordIn(List<String> values) {
addCriterion("user_password in", values, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotIn(List<String> values) {
addCriterion("user_password not in", values, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordBetween(String value1, String value2) {
addCriterion("user_password between", value1, value2, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotBetween(String value1, String value2) {
addCriterion("user_password not between", value1, value2, "userPassword");
return (Criteria) this;
}
public Criteria andUserRealNameIsNull() {
addCriterion("user_real_name is null");
return (Criteria) this;
}
public Criteria andUserRealNameIsNotNull() {
addCriterion("user_real_name is not null");
return (Criteria) this;
}
public Criteria andUserRealNameEqualTo(String value) {
addCriterion("user_real_name =", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotEqualTo(String value) {
addCriterion("user_real_name <>", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameGreaterThan(String value) {
addCriterion("user_real_name >", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameGreaterThanOrEqualTo(String value) {
addCriterion("user_real_name >=", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameLessThan(String value) {
addCriterion("user_real_name <", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameLessThanOrEqualTo(String value) {
addCriterion("user_real_name <=", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameLike(String value) {
addCriterion("user_real_name like", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotLike(String value) {
addCriterion("user_real_name not like", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameIn(List<String> values) {
addCriterion("user_real_name in", values, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotIn(List<String> values) {
addCriterion("user_real_name not in", values, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameBetween(String value1, String value2) {
addCriterion("user_real_name between", value1, value2, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotBetween(String value1, String value2) {
addCriterion("user_real_name not between", value1, value2, "userRealName");
return (Criteria) this;
}
public Criteria andUserGenderIsNull() {
addCriterion("user_gender is null");
return (Criteria) this;
}
public Criteria andUserGenderIsNotNull() {
addCriterion("user_gender is not null");
return (Criteria) this;
}
public Criteria andUserGenderEqualTo(Integer value) {
addCriterion("user_gender =", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderNotEqualTo(Integer value) {
addCriterion("user_gender <>", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderGreaterThan(Integer value) {
addCriterion("user_gender >", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderGreaterThanOrEqualTo(Integer value) {
addCriterion("user_gender >=", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderLessThan(Integer value) {
addCriterion("user_gender <", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderLessThanOrEqualTo(Integer value) {
addCriterion("user_gender <=", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderIn(List<Integer> values) {
addCriterion("user_gender in", values, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderNotIn(List<Integer> values) {
addCriterion("user_gender not in", values, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderBetween(Integer value1, Integer value2) {
addCriterion("user_gender between", value1, value2, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderNotBetween(Integer value1, Integer value2) {
addCriterion("user_gender not between", value1, value2, "userGender");
return (Criteria) this;
}
public Criteria andUserDescriptionIsNull() {
addCriterion("user_description is null");
return (Criteria) this;
}
public Criteria andUserDescriptionIsNotNull() {
addCriterion("user_description is not null");
return (Criteria) this;
}
public Criteria andUserDescriptionEqualTo(String value) {
addCriterion("user_description =", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotEqualTo(String value) {
addCriterion("user_description <>", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionGreaterThan(String value) {
addCriterion("user_description >", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("user_description >=", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionLessThan(String value) {
addCriterion("user_description <", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionLessThanOrEqualTo(String value) {
addCriterion("user_description <=", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionLike(String value) {
addCriterion("user_description like", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotLike(String value) {
addCriterion("user_description not like", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionIn(List<String> values) {
addCriterion("user_description in", values, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotIn(List<String> values) {
addCriterion("user_description not in", values, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionBetween(String value1, String value2) {
addCriterion("user_description between", value1, value2, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotBetween(String value1, String value2) {
addCriterion("user_description not between", value1, value2, "userDescription");
return (Criteria) this;
}
public Criteria andUserImageIsNull() {
addCriterion("user_image is null");
return (Criteria) this;
}
public Criteria andUserImageIsNotNull() {
addCriterion("user_image is not null");
return (Criteria) this;
}
public Criteria andUserImageEqualTo(String value) {
addCriterion("user_image =", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotEqualTo(String value) {
addCriterion("user_image <>", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageGreaterThan(String value) {
addCriterion("user_image >", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageGreaterThanOrEqualTo(String value) {
addCriterion("user_image >=", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageLessThan(String value) {
addCriterion("user_image <", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageLessThanOrEqualTo(String value) {
addCriterion("user_image <=", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageLike(String value) {
addCriterion("user_image like", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotLike(String value) {
addCriterion("user_image not like", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageIn(List<String> values) {
addCriterion("user_image in", values, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotIn(List<String> values) {
addCriterion("user_image not in", values, "userImage");
return (Criteria) this;
}
public Criteria andUserImageBetween(String value1, String value2) {
addCriterion("user_image between", value1, value2, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotBetween(String value1, String value2) {
addCriterion("user_image not between", value1, value2, "userImage");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table eshop_user
*
* @mbg.generated do_not_delete_during_merge Wed May 16 14:30:10 CST 2018
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | UTF-8 | Java | 38,436 | java | EshopUserCriteria.java | Java | []
| null | []
| package online.shixun.demo.eshop.dto;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class EshopUserCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public EshopUserCriteria() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIsDelIsNull() {
addCriterion("is_del is null");
return (Criteria) this;
}
public Criteria andIsDelIsNotNull() {
addCriterion("is_del is not null");
return (Criteria) this;
}
public Criteria andIsDelEqualTo(Integer value) {
addCriterion("is_del =", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotEqualTo(Integer value) {
addCriterion("is_del <>", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThan(Integer value) {
addCriterion("is_del >", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThanOrEqualTo(Integer value) {
addCriterion("is_del >=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThan(Integer value) {
addCriterion("is_del <", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThanOrEqualTo(Integer value) {
addCriterion("is_del <=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelIn(List<Integer> values) {
addCriterion("is_del in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotIn(List<Integer> values) {
addCriterion("is_del not in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelBetween(Integer value1, Integer value2) {
addCriterion("is_del between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotBetween(Integer value1, Integer value2) {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterionForJDBCDate("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterionForJDBCDate("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterionForJDBCDate("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterionForJDBCDate("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterionForJDBCDate("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterionForJDBCDate("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterionForJDBCDate("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterionForJDBCDate("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUserEmailIsNull() {
addCriterion("user_email is null");
return (Criteria) this;
}
public Criteria andUserEmailIsNotNull() {
addCriterion("user_email is not null");
return (Criteria) this;
}
public Criteria andUserEmailEqualTo(String value) {
addCriterion("user_email =", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotEqualTo(String value) {
addCriterion("user_email <>", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailGreaterThan(String value) {
addCriterion("user_email >", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailGreaterThanOrEqualTo(String value) {
addCriterion("user_email >=", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailLessThan(String value) {
addCriterion("user_email <", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailLessThanOrEqualTo(String value) {
addCriterion("user_email <=", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailLike(String value) {
addCriterion("user_email like", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotLike(String value) {
addCriterion("user_email not like", value, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailIn(List<String> values) {
addCriterion("user_email in", values, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotIn(List<String> values) {
addCriterion("user_email not in", values, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailBetween(String value1, String value2) {
addCriterion("user_email between", value1, value2, "userEmail");
return (Criteria) this;
}
public Criteria andUserEmailNotBetween(String value1, String value2) {
addCriterion("user_email not between", value1, value2, "userEmail");
return (Criteria) this;
}
public Criteria andUserLoginNameIsNull() {
addCriterion("user_login_name is null");
return (Criteria) this;
}
public Criteria andUserLoginNameIsNotNull() {
addCriterion("user_login_name is not null");
return (Criteria) this;
}
public Criteria andUserLoginNameEqualTo(String value) {
addCriterion("user_login_name =", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotEqualTo(String value) {
addCriterion("user_login_name <>", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameGreaterThan(String value) {
addCriterion("user_login_name >", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameGreaterThanOrEqualTo(String value) {
addCriterion("user_login_name >=", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameLessThan(String value) {
addCriterion("user_login_name <", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameLessThanOrEqualTo(String value) {
addCriterion("user_login_name <=", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameLike(String value) {
addCriterion("user_login_name like", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotLike(String value) {
addCriterion("user_login_name not like", value, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameIn(List<String> values) {
addCriterion("user_login_name in", values, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotIn(List<String> values) {
addCriterion("user_login_name not in", values, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameBetween(String value1, String value2) {
addCriterion("user_login_name between", value1, value2, "userLoginName");
return (Criteria) this;
}
public Criteria andUserLoginNameNotBetween(String value1, String value2) {
addCriterion("user_login_name not between", value1, value2, "userLoginName");
return (Criteria) this;
}
public Criteria andUserNicakNameIsNull() {
addCriterion("user_nicak_name is null");
return (Criteria) this;
}
public Criteria andUserNicakNameIsNotNull() {
addCriterion("user_nicak_name is not null");
return (Criteria) this;
}
public Criteria andUserNicakNameEqualTo(String value) {
addCriterion("user_nicak_name =", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotEqualTo(String value) {
addCriterion("user_nicak_name <>", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameGreaterThan(String value) {
addCriterion("user_nicak_name >", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameGreaterThanOrEqualTo(String value) {
addCriterion("user_nicak_name >=", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameLessThan(String value) {
addCriterion("user_nicak_name <", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameLessThanOrEqualTo(String value) {
addCriterion("user_nicak_name <=", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameLike(String value) {
addCriterion("user_nicak_name like", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotLike(String value) {
addCriterion("user_nicak_name not like", value, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameIn(List<String> values) {
addCriterion("user_nicak_name in", values, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotIn(List<String> values) {
addCriterion("user_nicak_name not in", values, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameBetween(String value1, String value2) {
addCriterion("user_nicak_name between", value1, value2, "userNicakName");
return (Criteria) this;
}
public Criteria andUserNicakNameNotBetween(String value1, String value2) {
addCriterion("user_nicak_name not between", value1, value2, "userNicakName");
return (Criteria) this;
}
public Criteria andUserPasswordIsNull() {
addCriterion("user_password is null");
return (Criteria) this;
}
public Criteria andUserPasswordIsNotNull() {
addCriterion("user_password is not null");
return (Criteria) this;
}
public Criteria andUserPasswordEqualTo(String value) {
addCriterion("user_password =", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotEqualTo(String value) {
addCriterion("user_password <>", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordGreaterThan(String value) {
addCriterion("user_password >", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordGreaterThanOrEqualTo(String value) {
addCriterion("user_password >=", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordLessThan(String value) {
addCriterion("user_password <", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordLessThanOrEqualTo(String value) {
addCriterion("user_password <=", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordLike(String value) {
addCriterion("user_password like", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotLike(String value) {
addCriterion("user_password not like", value, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordIn(List<String> values) {
addCriterion("user_password in", values, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotIn(List<String> values) {
addCriterion("user_password not in", values, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordBetween(String value1, String value2) {
addCriterion("user_password between", value1, value2, "userPassword");
return (Criteria) this;
}
public Criteria andUserPasswordNotBetween(String value1, String value2) {
addCriterion("user_password not between", value1, value2, "userPassword");
return (Criteria) this;
}
public Criteria andUserRealNameIsNull() {
addCriterion("user_real_name is null");
return (Criteria) this;
}
public Criteria andUserRealNameIsNotNull() {
addCriterion("user_real_name is not null");
return (Criteria) this;
}
public Criteria andUserRealNameEqualTo(String value) {
addCriterion("user_real_name =", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotEqualTo(String value) {
addCriterion("user_real_name <>", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameGreaterThan(String value) {
addCriterion("user_real_name >", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameGreaterThanOrEqualTo(String value) {
addCriterion("user_real_name >=", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameLessThan(String value) {
addCriterion("user_real_name <", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameLessThanOrEqualTo(String value) {
addCriterion("user_real_name <=", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameLike(String value) {
addCriterion("user_real_name like", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotLike(String value) {
addCriterion("user_real_name not like", value, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameIn(List<String> values) {
addCriterion("user_real_name in", values, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotIn(List<String> values) {
addCriterion("user_real_name not in", values, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameBetween(String value1, String value2) {
addCriterion("user_real_name between", value1, value2, "userRealName");
return (Criteria) this;
}
public Criteria andUserRealNameNotBetween(String value1, String value2) {
addCriterion("user_real_name not between", value1, value2, "userRealName");
return (Criteria) this;
}
public Criteria andUserGenderIsNull() {
addCriterion("user_gender is null");
return (Criteria) this;
}
public Criteria andUserGenderIsNotNull() {
addCriterion("user_gender is not null");
return (Criteria) this;
}
public Criteria andUserGenderEqualTo(Integer value) {
addCriterion("user_gender =", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderNotEqualTo(Integer value) {
addCriterion("user_gender <>", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderGreaterThan(Integer value) {
addCriterion("user_gender >", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderGreaterThanOrEqualTo(Integer value) {
addCriterion("user_gender >=", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderLessThan(Integer value) {
addCriterion("user_gender <", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderLessThanOrEqualTo(Integer value) {
addCriterion("user_gender <=", value, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderIn(List<Integer> values) {
addCriterion("user_gender in", values, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderNotIn(List<Integer> values) {
addCriterion("user_gender not in", values, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderBetween(Integer value1, Integer value2) {
addCriterion("user_gender between", value1, value2, "userGender");
return (Criteria) this;
}
public Criteria andUserGenderNotBetween(Integer value1, Integer value2) {
addCriterion("user_gender not between", value1, value2, "userGender");
return (Criteria) this;
}
public Criteria andUserDescriptionIsNull() {
addCriterion("user_description is null");
return (Criteria) this;
}
public Criteria andUserDescriptionIsNotNull() {
addCriterion("user_description is not null");
return (Criteria) this;
}
public Criteria andUserDescriptionEqualTo(String value) {
addCriterion("user_description =", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotEqualTo(String value) {
addCriterion("user_description <>", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionGreaterThan(String value) {
addCriterion("user_description >", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("user_description >=", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionLessThan(String value) {
addCriterion("user_description <", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionLessThanOrEqualTo(String value) {
addCriterion("user_description <=", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionLike(String value) {
addCriterion("user_description like", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotLike(String value) {
addCriterion("user_description not like", value, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionIn(List<String> values) {
addCriterion("user_description in", values, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotIn(List<String> values) {
addCriterion("user_description not in", values, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionBetween(String value1, String value2) {
addCriterion("user_description between", value1, value2, "userDescription");
return (Criteria) this;
}
public Criteria andUserDescriptionNotBetween(String value1, String value2) {
addCriterion("user_description not between", value1, value2, "userDescription");
return (Criteria) this;
}
public Criteria andUserImageIsNull() {
addCriterion("user_image is null");
return (Criteria) this;
}
public Criteria andUserImageIsNotNull() {
addCriterion("user_image is not null");
return (Criteria) this;
}
public Criteria andUserImageEqualTo(String value) {
addCriterion("user_image =", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotEqualTo(String value) {
addCriterion("user_image <>", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageGreaterThan(String value) {
addCriterion("user_image >", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageGreaterThanOrEqualTo(String value) {
addCriterion("user_image >=", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageLessThan(String value) {
addCriterion("user_image <", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageLessThanOrEqualTo(String value) {
addCriterion("user_image <=", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageLike(String value) {
addCriterion("user_image like", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotLike(String value) {
addCriterion("user_image not like", value, "userImage");
return (Criteria) this;
}
public Criteria andUserImageIn(List<String> values) {
addCriterion("user_image in", values, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotIn(List<String> values) {
addCriterion("user_image not in", values, "userImage");
return (Criteria) this;
}
public Criteria andUserImageBetween(String value1, String value2) {
addCriterion("user_image between", value1, value2, "userImage");
return (Criteria) this;
}
public Criteria andUserImageNotBetween(String value1, String value2) {
addCriterion("user_image not between", value1, value2, "userImage");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table eshop_user
*
* @mbg.generated do_not_delete_during_merge Wed May 16 14:30:10 CST 2018
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table eshop_user
*
* @mbg.generated Wed May 16 14:30:10 CST 2018
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | 38,436 | 0.595666 | 0.58747 | 1,130 | 33.015045 | 27.586946 | 120 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.675221 | false | false | 0 |
622f3d68e05e5d13778a533fc23c0a445746253e | 8,641,474,211,735 | dfe6063c215cccac964653601bd02a7dfdca2820 | /src/main/java/com/costan/webshop/business/domain/model/ShoppingCart.java | 8e42b230fdbe8fa465044401dd9ac09cdde61708 | []
| no_license | srcostan/webshop | https://github.com/srcostan/webshop | 17413bf7728ab4cfed386acbea1125b74597340b | f05223cfd5ea95d0d6d60730b072d4854db9f9e3 | refs/heads/master | 2022-11-30T05:31:49.857000 | 2020-08-17T23:25:15 | 2020-08-17T23:25:15 | 280,845,996 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.costan.webshop.business.domain.model;
import java.util.List;
public class ShoppingCart {
private List<Product> products;
public ShoppingCart(List<Product> products) {
this.products = products;
}
public Double getTotalPrice() {
return products.stream().mapToDouble(p -> p.getPrice()).sum();
}
public List<Product> getProducts() {
return products;
}
}
| UTF-8 | Java | 420 | java | ShoppingCart.java | Java | []
| null | []
| package com.costan.webshop.business.domain.model;
import java.util.List;
public class ShoppingCart {
private List<Product> products;
public ShoppingCart(List<Product> products) {
this.products = products;
}
public Double getTotalPrice() {
return products.stream().mapToDouble(p -> p.getPrice()).sum();
}
public List<Product> getProducts() {
return products;
}
}
| 420 | 0.659524 | 0.659524 | 20 | 20 | 20.863844 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false | 0 |
89d4187158e29889055d91c37932bef05a65f56a | 7,258,494,778,005 | 2bab4bb4f5007ddfb9d669eba8010af603f0db05 | /martin.bach.zapproject/src/battle/ai/AdvancedSingleProtocol.java | 46b5f9886efff444d50632ed3508baed8bc7c90e | []
| no_license | DeltaTecs/Zapper | https://github.com/DeltaTecs/Zapper | 41dd977a496762e4b79b92a59723674b9028397f | 11ed3858cf69b3121e3bbd8f4453b6c03f1fb7f6 | refs/heads/master | 2021-01-19T20:12:27.071000 | 2018-07-09T15:01:52 | 2018-07-09T15:01:52 | 88,423,413 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package battle.ai;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import battle.CombatObject;
import battle.enemy.Enemy;
import battle.looting.Storage;
import battle.projectile.Projectile;
import collision.Collideable;
import collision.Grid;
import corecase.MainZap;
import err.MissingShipLinkageException;
import gui.Map;
import ingameobjects.InteractiveObject;
import ingameobjects.Player;
public class AdvancedSingleProtocol extends AiProtocol {
private static final int MAX_STOP_TIME = MainZap.getMainLoop().inTicks(32000);
private static final int MAX_MOVING_TIME_IDLE = MainZap.getMainLoop().inTicks(4000);
private static final int MAX_MOVING_TIME_COMBAT = MainZap.getMainLoop().inTicks(2000);
private static final int FORCED_MOVING_TIME_IDLE = MainZap.getMainLoop().inTicks(3500);
private static final int FORCED_MOVING_TIME_COMBAT = MainZap.getMainLoop().inTicks(200);
private static final int FORCED_WAITING_TIME = MainZap.getMainLoop().inTicks(2000);
private static final int TIME_GOING_BACK_INTO_COMBAT = MainZap.inTicks(1800);
private static final int COMBAT_FOLLOWUP_COOLDOWN = MainZap.inTicks(1000);
private int ancX, ancY; // Lokalisation, von der nicht abgewichen werden
// soll
private int ancRange; // wie weit abgewichen werden darf
private int ancRandReturn; // Wahrscheinlichkeit dann umzudrehen
private int ancRadian; // In welchem Radius dieses Anker operiert
private int ancAimX, ancAimY; // Temporäres Anker lock-on für Bewegung
private boolean anchored = false; // Ob überhaupt verankert
private boolean ancInAction = false; // Am zurück fliegen?
private boolean ancCrowdEnabled = false; // Anker automatisch in der
// armee-mitte setzen?
// Was tun wenn ohne Lock?
private FindLockAction lockAction = FindLockAction.LOCK_ENEMYS_INRANGE;
private boolean noAlternativeLock = false;
private int timeToNextMovementAction = 2;
private int combatFollowupCooldown = 0;
private boolean wasInCombat = false;
private Rectangle movementBounds = null; // Brgrenztes bewegungs-Gebiet
private int lockCombatFreeMovementRange = 100;
// Ab welcher relativ zur out-of-range-range gesehenen Range soll die
// Distanz verringert werden?
private float combatRangePerOutOfRangeRange = 0.75f; // -> 75%
private ArrayList<CombatObject> linkedAllies;
private ArrayList<CombatObject> linkedEnemys;
public AdvancedSingleProtocol() {
}
@Override
public void updateMovement() {
if (updateAnchor())
return; // Anker-Bewegung vorgenommen
if (isIdleing()) { // reguläre Bewegung
super.updateMovement();
return;
}
// Bewegung in Kampfhandlung
int maxCombatDistance = (int) (getLockOutOfRangeRange() * combatRangePerOutOfRangeRange);
InteractiveObject lock = getLockOn();
int distance = Grid.distance(new Point(lock.getLocX(), lock.getLocY()),
new Point(getHost().getLocX(), getHost().getLocY()));
if (combatFollowupCooldown > 0)
combatFollowupCooldown--;
if (distance >= maxCombatDistance) {
if (combatFollowupCooldown == 0) {
combatFollowupCooldown = COMBAT_FOLLOWUP_COOLDOWN;
// Im Kampf, aus der Range gelangt
// In Range bleiben!
moveTo(rand(2 * lockCombatFreeMovementRange) - lockCombatFreeMovementRange + lock.getLocX(),
rand(2 * lockCombatFreeMovementRange) - lockCombatFreeMovementRange + lock.getLocY());
move();
timeToNextMovementAction = TIME_GOING_BACK_INTO_COMBAT;
return;
}
}
if (timeToNextMovementAction > 0) { // warten
timeToNextMovementAction--;
} else { // handeln
moveTo((int) (getHost().getPosX() + rand(2000) - 1000), (int) (getHost().getPosY() + rand(2000) - 1000));
timeToNextMovementAction = FORCED_MOVING_TIME_COMBAT + rand(MAX_MOVING_TIME_COMBAT);
}
move();
}
@Override
public void updateIdle() {
if (timeToNextMovementAction > 0) {
timeToNextMovementAction--;
} else {
// Am Zug.
if (isMoving() && !wasInCombat) { // Jetzt Stoppen
stopMoving();
timeToNextMovementAction = FORCED_WAITING_TIME + rand(MAX_STOP_TIME);
} else { // Jetzt Bewegen
if (wasInCombat)
wasInCombat = false;
if (movementBounds == null) { // Auf ganzer Map bewegen
moveTo(rand(Map.SIZE), rand(Map.SIZE));
} else { // Die Bounds anaimen
moveTo(rand(movementBounds.width) + movementBounds.x,
rand(movementBounds.height) + movementBounds.y);
}
timeToNextMovementAction = FORCED_MOVING_TIME_IDLE + rand(MAX_MOVING_TIME_IDLE);
}
}
}
// --- Lock-On ----------------------
@Override
public void updateLockOn() {
if (getLockOn() == null) { // Kein Lock
if (!tryLockOn() && !noAlternativeLock && lockAction != FindLockAction.NO_AUTO_LOCK) // Nochmal suchen
setLockOn(searchForLock());
} else { // Hat Lock
if (!wasInCombat)
wasInCombat = true;
if (getLockOn() instanceof Enemy) {
Enemy lock = (Enemy) getLockOn();
if (!lock.isInRange(getHost(), getLockOutOfRangeRange())
&& lockAction != FindLockAction.LOCK_LINKED_ENEMYS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS_INRANGE)
setLockOn(null); // Fallen lassen
else if (!lock.isAlive())
setLockOn(null);
} else if (getLockOn() instanceof Player) {
if (getLockOn().distanceToPlayer() > getLockOutOfRangeRange()
&& lockAction != FindLockAction.LOCK_LINKED_ENEMYS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS_INRANGE)
setLockOn(null); // Fallen lassen
else if (!MainZap.getPlayer().isAlive())
setLockOn(null);
}
}
}
// Versucht einen Lock-On im Rahmen der Lock-Action
// Gibt TRUE zurück, wenn einer getätigt wurde
private boolean tryLockOn() {
switch (lockAction) {
case LOCK_ENEMYS_INRANGE:
// Was aus der Umgebung holen
setLockOn(searchForLock());
return getLockOn() != null;
case LOCK_LINKED_ENEMYS:
// Was verknüpfter holen
if (linkedEnemys == null) // NullPointer
throw new MissingShipLinkageException("linked enemys is null");
if (linkedEnemys.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> aliveLocks0 = new ArrayList<CombatObject>();
for (CombatObject e : linkedEnemys)
if (e.isAlive())
aliveLocks0.add(e);
if (aliveLocks0.size() == 0)
return false; // nix lebendiges da
setLockOn(aliveLocks0.get(rand(aliveLocks0.size())));
return true;
case LOCK_LINKED_ENEMYS_INRANGE:
// Was Verknüpftes in Radius holen
if (linkedEnemys == null) // NullPointer
throw new MissingShipLinkageException("linked enemys is null");
if (linkedEnemys.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> inRange = new ArrayList<CombatObject>();
for (CombatObject e : linkedEnemys)
if (e.isInRange(getHost(), getLockOpticDetectionRange()) && e.isAlive())
inRange.add(e); // In range
if (inRange.size() == 0)
return false;
setLockOn(inRange.get(rand(inRange.size())));
return true;
case LOCK_LOCK_OF_FRIENDS_INRANGE:
// Was locken, was andere im Radius locken
ArrayList<Collideable> surrounding = MainZap.getGrid().getTotalSurrounding(getHost().getLocX(),
getHost().getLocY(), getLockOpticDetectionRange());
ArrayList<CombatObject> possibleLocks = new ArrayList<CombatObject>();
for (Collideable c : surrounding) {
if (c instanceof Enemy) { // Entity
Enemy e = (Enemy) c;
if (e.isFriend() == getHost().isFriend()) // Gleichgesittteter
if (e.isInRange(getHost(), getLockOpticDetectionRange()))
if (e.getAiProtocol().getLockOn() != null && e.getAiProtocol().getLockOn().isAlive()) // lockt
possibleLocks.add(e.getAiProtocol().getLockOn());
}
}
if (possibleLocks.size() == 0)
return false;
setLockOn(possibleLocks.get(rand(possibleLocks.size())));
return true;
case LOCK_LOCK_OF_LINKED_FRIENDS:
// Was von was verknüpftem holen
if (linkedAllies == null) // NullPointer
throw new MissingShipLinkageException("linked allies is null");
if (linkedAllies.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> possibleLocks1 = new ArrayList<CombatObject>();
for (CombatObject e : linkedAllies)
if (e instanceof Enemy)
if (((Enemy) e).getAiProtocol().getLockOn() != null && e.isAlive()
&& ((Enemy) e).getAiProtocol().getLockOn().isAlive())
possibleLocks1.add(((Enemy) e).getAiProtocol().getLockOn());
if (possibleLocks1.size() == 0)
return false;
setLockOn(possibleLocks1.get(rand(possibleLocks1.size())));
return true;
case LOCK_LOCK_OF_LINKED_FRIENDS_INRANGE:
// Was von was verknüpftem holen was in range ist
if (linkedAllies == null) // NullPointer
throw new MissingShipLinkageException("linked allies is null");
if (linkedAllies.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> possibleLocks2 = new ArrayList<CombatObject>();
for (CombatObject o : linkedAllies)
if (o instanceof Enemy) {
Enemy e = (Enemy) o;
if (e.isInRange(getHost(), getLockOpticDetectionRange()) && e.getAiProtocol().getLockOn() != null
&& e.getAiProtocol().getLockOn().isAlive())
possibleLocks2.add(e.getAiProtocol().getLockOn());
}
if (possibleLocks2.size() == 0)
return false;
setLockOn(possibleLocks2.get(rand(possibleLocks2.size())));
return true;
case NO_AUTO_LOCK:
return false;
default: // Gibts nicht
return false;
}
}
public void preLock(ArrayList<CombatObject> enemys) {
ArrayList<CombatObject> possibleLocks = new ArrayList<CombatObject>();
for (CombatObject e : enemys) {
// Muss Enemy sein. Sonst invalid
if (e.isFriend() != getHost().isFriend())
possibleLocks.add(e);
}
if (!getHost().isFriend()) // Falls Gengner, Spieler auch lockbar
possibleLocks.add(MainZap.getPlayer());
if (possibleLocks.size() == 0)
return; // nix da zum locken
CombatObject lock = possibleLocks.get(rand(possibleLocks.size()));
setLockOn(lock);
getHost().setShootingAim(lock);
}
// Lock-On aus der Umgebung fischen
public CombatObject searchForLock() {
ArrayList<CombatObject> possibleLocks = new ArrayList<CombatObject>();
if (!getHost().isFriend()) {
if (getHost().distanceToPlayer() <= super.getLockOpticDetectionRange() && MainZap.getPlayer().isAlive()) {
if (isPrioritisePlayerAsLockOn())
return MainZap.getPlayer();
possibleLocks.add(MainZap.getPlayer());
}
}
// Umgebung holen
ArrayList<Enemy> surrounding = MainZap.getGrid().getEnemySurrounding(getHost().getLocX(), getHost().getLocY(),
super.getLockOpticDetectionRange());
// Umgebung abgehen
for (Enemy e : surrounding) {
if (e.isFriend() == getHost().isFriend() || !e.isAlive() || e instanceof Storage)
continue; // Keinen der eigenen Sippschaft oder Tote anvisieren
// Da is was in Range
if (e.isInRange(getHost(), super.getLockOpticDetectionRange()))
possibleLocks.add(e);
}
if (possibleLocks.size() == 0)
return null; // nix da zum locken
return possibleLocks.get(rand(possibleLocks.size()));
}
// ------------
// ----- Anchor ------------------------------
// Updated den Anker und gibt TRUE zurück, wenn bewegende Aktionen
// vorgenommen wurden
private boolean updateAnchor() {
if (!anchored)
return false;
if (ancCrowdEnabled) { // Ankerpunkt in das Armee-Zentrum verschieben
if (linkedAllies == null)
throw new MissingShipLinkageException("linked allies null");
int totX = 0;
int totY = 0;
for (InteractiveObject e : linkedAllies) {
totX += (int) e.getPosX();
totY += (int) e.getPosY();
}
ancX = totX / linkedAllies.size();
ancY = totY / linkedAllies.size();
}
if (ancInAction) {
// Anker wird schon beansprucht.
if (anchorReached()) {
ancInAction = false;
return false; // Angekommen. Aufheben.
} else {
move();
return true;
}
} else { // Noch kein Anker in Aktion
if (anchorCallNeeded()) { // Anker in Aktion benötigt
ancInAction = true;
ancAimX = ancX + rand(ancRadian * 2) - ancRadian;
ancAimY = ancY + rand(ancRadian * 2) - ancRadian;
getHost().getVelocity().aimFor(getHost().getLocX(), getHost().getLocY(), getHost().getSpeed(), ancAimX,
ancAimY);
move();
return true;
} else // Nix benötigt
return false;
}
}
@Override
public void setDamageRecognizeable() {
DamageCall call = new DamageCall() {
@Override
public void damage(CombatObject source, Projectile proj, int dmg) {
// Zur Quelle gehen, falls lockon nicht schon vorhanden
if (getLockOn() != null)
return;
if (anchored) // Im Anker-Prozess nicht umdrehen
return;
// Distanz prüfen
if (!source.isInRange(getHost(), getLockPhysicalDetectionRange()))
return;
if (source == MainZap.getPlayer() && getHost().isFriend())
return; // Friendly-Fire
// Alle Bedingungen erfüllt
if (isParked()) // Park-Bremse aufheben
setParked(false);
setLockOn(source);
getHost().setShootingAim(source);
}
};
addCall(KEY_CALL_GETTING_DAMAGED, call);
}
private boolean anchorCallNeeded() {
if (Grid.distance(new Point(getHost().getLocX(), getHost().getLocY()), new Point(ancX, ancY)) < ancRange)
return false; // Noch in Range
if (rand(ancRandReturn) == 0)
return true; // Trotz Out-Of-Range noch warten
// Out of range und keine Ausnahme.
return false;
}
private boolean anchorReached() {
if (Grid.distance(new Point(getHost().getLocX(), getHost().getLocY()), new Point(ancX, ancY)) < ancRadian)
return true; // Im Radius
return false; // Nicht im Radius...
}
// Anker aufheben
public void removeAnchor() {
anchored = false;
ancInAction = false;
}
// Anker setzen
public void anchor(int x, int y, int ancRadian, int maxDistance, int returnRand) {
ancX = x;
ancY = y;
ancRange = maxDistance;
this.ancRadian = ancRadian;
ancRandReturn = returnRand;
anchored = true;
ancInAction = false;
}
public void setEnableCrowdAnchor(boolean enable) {
ancCrowdEnabled = enable;
}
// -------------
protected void move() {
getHost().moveX(getHost().getVelocity().getX());
getHost().moveY(getHost().getVelocity().getY());
}
public ArrayList<CombatObject> getLinkedAllies() {
return linkedAllies;
}
public void setLinkedAllies(ArrayList<CombatObject> linkedAllies) {
this.linkedAllies = linkedAllies;
}
public ArrayList<CombatObject> getLinkedEnemys() {
return linkedEnemys;
}
public void setLinkedEnemys(ArrayList<CombatObject> linkedEnemys) {
this.linkedEnemys = linkedEnemys;
}
public int getAncX() {
return ancX;
}
public void setAncX(int ancX) {
this.ancX = ancX;
}
public int getAncY() {
return ancY;
}
public void setAncY(int ancY) {
this.ancY = ancY;
}
public int getAncRange() {
return ancRange;
}
public void setAncRange(int ancRange) {
this.ancRange = ancRange;
}
public int getAncRandReturn() {
return ancRandReturn;
}
public void setAncRandReturn(int ancRandReturn) {
this.ancRandReturn = ancRandReturn;
}
public int getAncRadian() {
return ancRadian;
}
public void setAncRadian(int ancRadian) {
this.ancRadian = ancRadian;
}
public int getAncAimX() {
return ancAimX;
}
public void setAncAimX(int ancAimX) {
this.ancAimX = ancAimX;
}
public int getAncAimY() {
return ancAimY;
}
public void setAncAimY(int ancAimY) {
this.ancAimY = ancAimY;
}
public FindLockAction getLockAction() {
return lockAction;
}
public void setLockAction(FindLockAction lockAction) {
this.lockAction = lockAction;
}
public Rectangle getMovementBounds() {
return movementBounds;
}
public void setMovementBounds(Rectangle movementBounds) {
this.movementBounds = movementBounds;
}
public int getLockCombatFreeMovementRange() {
return lockCombatFreeMovementRange;
}
public void setLockCombatFreeMovementRange(int lockCombatFreeMovementRange) {
this.lockCombatFreeMovementRange = lockCombatFreeMovementRange;
}
public float getCombatRangePerOutOfRangeRange() {
return combatRangePerOutOfRangeRange;
}
public void setCombatRangePerOutOfRangeRange(float combatRangePerOutOfRangeRange) {
this.combatRangePerOutOfRangeRange = combatRangePerOutOfRangeRange;
}
public boolean isAnchored() {
return anchored;
}
public boolean isAncInAction() {
return ancInAction;
}
public boolean isAncCrowdEnabled() {
return ancCrowdEnabled;
}
public boolean isNoAlternativeLock() {
return noAlternativeLock;
}
public void setNoAlternativeLock(boolean noAlternativeLock) {
this.noAlternativeLock = noAlternativeLock;
}
@Override
public Object getClone() {
return new AdvancedSingleProtocol();
}
}
| ISO-8859-1 | Java | 17,489 | java | AdvancedSingleProtocol.java | Java | [
{
"context": "(e);\r\n\t\t}\r\n\r\n\t\tif (!getHost().isFriend()) // Falls Gengner, Spieler auch lockbar\r\n\t\t\tpossibleLocks.add(Ma",
"end": 10208,
"score": 0.7808140516281128,
"start": 10204,
"tag": "NAME",
"value": "Geng"
}
]
| null | []
| package battle.ai;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import battle.CombatObject;
import battle.enemy.Enemy;
import battle.looting.Storage;
import battle.projectile.Projectile;
import collision.Collideable;
import collision.Grid;
import corecase.MainZap;
import err.MissingShipLinkageException;
import gui.Map;
import ingameobjects.InteractiveObject;
import ingameobjects.Player;
public class AdvancedSingleProtocol extends AiProtocol {
private static final int MAX_STOP_TIME = MainZap.getMainLoop().inTicks(32000);
private static final int MAX_MOVING_TIME_IDLE = MainZap.getMainLoop().inTicks(4000);
private static final int MAX_MOVING_TIME_COMBAT = MainZap.getMainLoop().inTicks(2000);
private static final int FORCED_MOVING_TIME_IDLE = MainZap.getMainLoop().inTicks(3500);
private static final int FORCED_MOVING_TIME_COMBAT = MainZap.getMainLoop().inTicks(200);
private static final int FORCED_WAITING_TIME = MainZap.getMainLoop().inTicks(2000);
private static final int TIME_GOING_BACK_INTO_COMBAT = MainZap.inTicks(1800);
private static final int COMBAT_FOLLOWUP_COOLDOWN = MainZap.inTicks(1000);
private int ancX, ancY; // Lokalisation, von der nicht abgewichen werden
// soll
private int ancRange; // wie weit abgewichen werden darf
private int ancRandReturn; // Wahrscheinlichkeit dann umzudrehen
private int ancRadian; // In welchem Radius dieses Anker operiert
private int ancAimX, ancAimY; // Temporäres Anker lock-on für Bewegung
private boolean anchored = false; // Ob überhaupt verankert
private boolean ancInAction = false; // Am zurück fliegen?
private boolean ancCrowdEnabled = false; // Anker automatisch in der
// armee-mitte setzen?
// Was tun wenn ohne Lock?
private FindLockAction lockAction = FindLockAction.LOCK_ENEMYS_INRANGE;
private boolean noAlternativeLock = false;
private int timeToNextMovementAction = 2;
private int combatFollowupCooldown = 0;
private boolean wasInCombat = false;
private Rectangle movementBounds = null; // Brgrenztes bewegungs-Gebiet
private int lockCombatFreeMovementRange = 100;
// Ab welcher relativ zur out-of-range-range gesehenen Range soll die
// Distanz verringert werden?
private float combatRangePerOutOfRangeRange = 0.75f; // -> 75%
private ArrayList<CombatObject> linkedAllies;
private ArrayList<CombatObject> linkedEnemys;
public AdvancedSingleProtocol() {
}
@Override
public void updateMovement() {
if (updateAnchor())
return; // Anker-Bewegung vorgenommen
if (isIdleing()) { // reguläre Bewegung
super.updateMovement();
return;
}
// Bewegung in Kampfhandlung
int maxCombatDistance = (int) (getLockOutOfRangeRange() * combatRangePerOutOfRangeRange);
InteractiveObject lock = getLockOn();
int distance = Grid.distance(new Point(lock.getLocX(), lock.getLocY()),
new Point(getHost().getLocX(), getHost().getLocY()));
if (combatFollowupCooldown > 0)
combatFollowupCooldown--;
if (distance >= maxCombatDistance) {
if (combatFollowupCooldown == 0) {
combatFollowupCooldown = COMBAT_FOLLOWUP_COOLDOWN;
// Im Kampf, aus der Range gelangt
// In Range bleiben!
moveTo(rand(2 * lockCombatFreeMovementRange) - lockCombatFreeMovementRange + lock.getLocX(),
rand(2 * lockCombatFreeMovementRange) - lockCombatFreeMovementRange + lock.getLocY());
move();
timeToNextMovementAction = TIME_GOING_BACK_INTO_COMBAT;
return;
}
}
if (timeToNextMovementAction > 0) { // warten
timeToNextMovementAction--;
} else { // handeln
moveTo((int) (getHost().getPosX() + rand(2000) - 1000), (int) (getHost().getPosY() + rand(2000) - 1000));
timeToNextMovementAction = FORCED_MOVING_TIME_COMBAT + rand(MAX_MOVING_TIME_COMBAT);
}
move();
}
@Override
public void updateIdle() {
if (timeToNextMovementAction > 0) {
timeToNextMovementAction--;
} else {
// Am Zug.
if (isMoving() && !wasInCombat) { // Jetzt Stoppen
stopMoving();
timeToNextMovementAction = FORCED_WAITING_TIME + rand(MAX_STOP_TIME);
} else { // Jetzt Bewegen
if (wasInCombat)
wasInCombat = false;
if (movementBounds == null) { // Auf ganzer Map bewegen
moveTo(rand(Map.SIZE), rand(Map.SIZE));
} else { // Die Bounds anaimen
moveTo(rand(movementBounds.width) + movementBounds.x,
rand(movementBounds.height) + movementBounds.y);
}
timeToNextMovementAction = FORCED_MOVING_TIME_IDLE + rand(MAX_MOVING_TIME_IDLE);
}
}
}
// --- Lock-On ----------------------
@Override
public void updateLockOn() {
if (getLockOn() == null) { // Kein Lock
if (!tryLockOn() && !noAlternativeLock && lockAction != FindLockAction.NO_AUTO_LOCK) // Nochmal suchen
setLockOn(searchForLock());
} else { // Hat Lock
if (!wasInCombat)
wasInCombat = true;
if (getLockOn() instanceof Enemy) {
Enemy lock = (Enemy) getLockOn();
if (!lock.isInRange(getHost(), getLockOutOfRangeRange())
&& lockAction != FindLockAction.LOCK_LINKED_ENEMYS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS_INRANGE)
setLockOn(null); // Fallen lassen
else if (!lock.isAlive())
setLockOn(null);
} else if (getLockOn() instanceof Player) {
if (getLockOn().distanceToPlayer() > getLockOutOfRangeRange()
&& lockAction != FindLockAction.LOCK_LINKED_ENEMYS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS
&& lockAction != FindLockAction.LOCK_LOCK_OF_LINKED_FRIENDS_INRANGE)
setLockOn(null); // Fallen lassen
else if (!MainZap.getPlayer().isAlive())
setLockOn(null);
}
}
}
// Versucht einen Lock-On im Rahmen der Lock-Action
// Gibt TRUE zurück, wenn einer getätigt wurde
private boolean tryLockOn() {
switch (lockAction) {
case LOCK_ENEMYS_INRANGE:
// Was aus der Umgebung holen
setLockOn(searchForLock());
return getLockOn() != null;
case LOCK_LINKED_ENEMYS:
// Was verknüpfter holen
if (linkedEnemys == null) // NullPointer
throw new MissingShipLinkageException("linked enemys is null");
if (linkedEnemys.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> aliveLocks0 = new ArrayList<CombatObject>();
for (CombatObject e : linkedEnemys)
if (e.isAlive())
aliveLocks0.add(e);
if (aliveLocks0.size() == 0)
return false; // nix lebendiges da
setLockOn(aliveLocks0.get(rand(aliveLocks0.size())));
return true;
case LOCK_LINKED_ENEMYS_INRANGE:
// Was Verknüpftes in Radius holen
if (linkedEnemys == null) // NullPointer
throw new MissingShipLinkageException("linked enemys is null");
if (linkedEnemys.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> inRange = new ArrayList<CombatObject>();
for (CombatObject e : linkedEnemys)
if (e.isInRange(getHost(), getLockOpticDetectionRange()) && e.isAlive())
inRange.add(e); // In range
if (inRange.size() == 0)
return false;
setLockOn(inRange.get(rand(inRange.size())));
return true;
case LOCK_LOCK_OF_FRIENDS_INRANGE:
// Was locken, was andere im Radius locken
ArrayList<Collideable> surrounding = MainZap.getGrid().getTotalSurrounding(getHost().getLocX(),
getHost().getLocY(), getLockOpticDetectionRange());
ArrayList<CombatObject> possibleLocks = new ArrayList<CombatObject>();
for (Collideable c : surrounding) {
if (c instanceof Enemy) { // Entity
Enemy e = (Enemy) c;
if (e.isFriend() == getHost().isFriend()) // Gleichgesittteter
if (e.isInRange(getHost(), getLockOpticDetectionRange()))
if (e.getAiProtocol().getLockOn() != null && e.getAiProtocol().getLockOn().isAlive()) // lockt
possibleLocks.add(e.getAiProtocol().getLockOn());
}
}
if (possibleLocks.size() == 0)
return false;
setLockOn(possibleLocks.get(rand(possibleLocks.size())));
return true;
case LOCK_LOCK_OF_LINKED_FRIENDS:
// Was von was verknüpftem holen
if (linkedAllies == null) // NullPointer
throw new MissingShipLinkageException("linked allies is null");
if (linkedAllies.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> possibleLocks1 = new ArrayList<CombatObject>();
for (CombatObject e : linkedAllies)
if (e instanceof Enemy)
if (((Enemy) e).getAiProtocol().getLockOn() != null && e.isAlive()
&& ((Enemy) e).getAiProtocol().getLockOn().isAlive())
possibleLocks1.add(((Enemy) e).getAiProtocol().getLockOn());
if (possibleLocks1.size() == 0)
return false;
setLockOn(possibleLocks1.get(rand(possibleLocks1.size())));
return true;
case LOCK_LOCK_OF_LINKED_FRIENDS_INRANGE:
// Was von was verknüpftem holen was in range ist
if (linkedAllies == null) // NullPointer
throw new MissingShipLinkageException("linked allies is null");
if (linkedAllies.size() == 0)
return false; // nix da zum locken
ArrayList<CombatObject> possibleLocks2 = new ArrayList<CombatObject>();
for (CombatObject o : linkedAllies)
if (o instanceof Enemy) {
Enemy e = (Enemy) o;
if (e.isInRange(getHost(), getLockOpticDetectionRange()) && e.getAiProtocol().getLockOn() != null
&& e.getAiProtocol().getLockOn().isAlive())
possibleLocks2.add(e.getAiProtocol().getLockOn());
}
if (possibleLocks2.size() == 0)
return false;
setLockOn(possibleLocks2.get(rand(possibleLocks2.size())));
return true;
case NO_AUTO_LOCK:
return false;
default: // Gibts nicht
return false;
}
}
public void preLock(ArrayList<CombatObject> enemys) {
ArrayList<CombatObject> possibleLocks = new ArrayList<CombatObject>();
for (CombatObject e : enemys) {
// Muss Enemy sein. Sonst invalid
if (e.isFriend() != getHost().isFriend())
possibleLocks.add(e);
}
if (!getHost().isFriend()) // Falls Gengner, Spieler auch lockbar
possibleLocks.add(MainZap.getPlayer());
if (possibleLocks.size() == 0)
return; // nix da zum locken
CombatObject lock = possibleLocks.get(rand(possibleLocks.size()));
setLockOn(lock);
getHost().setShootingAim(lock);
}
// Lock-On aus der Umgebung fischen
public CombatObject searchForLock() {
ArrayList<CombatObject> possibleLocks = new ArrayList<CombatObject>();
if (!getHost().isFriend()) {
if (getHost().distanceToPlayer() <= super.getLockOpticDetectionRange() && MainZap.getPlayer().isAlive()) {
if (isPrioritisePlayerAsLockOn())
return MainZap.getPlayer();
possibleLocks.add(MainZap.getPlayer());
}
}
// Umgebung holen
ArrayList<Enemy> surrounding = MainZap.getGrid().getEnemySurrounding(getHost().getLocX(), getHost().getLocY(),
super.getLockOpticDetectionRange());
// Umgebung abgehen
for (Enemy e : surrounding) {
if (e.isFriend() == getHost().isFriend() || !e.isAlive() || e instanceof Storage)
continue; // Keinen der eigenen Sippschaft oder Tote anvisieren
// Da is was in Range
if (e.isInRange(getHost(), super.getLockOpticDetectionRange()))
possibleLocks.add(e);
}
if (possibleLocks.size() == 0)
return null; // nix da zum locken
return possibleLocks.get(rand(possibleLocks.size()));
}
// ------------
// ----- Anchor ------------------------------
// Updated den Anker und gibt TRUE zurück, wenn bewegende Aktionen
// vorgenommen wurden
private boolean updateAnchor() {
if (!anchored)
return false;
if (ancCrowdEnabled) { // Ankerpunkt in das Armee-Zentrum verschieben
if (linkedAllies == null)
throw new MissingShipLinkageException("linked allies null");
int totX = 0;
int totY = 0;
for (InteractiveObject e : linkedAllies) {
totX += (int) e.getPosX();
totY += (int) e.getPosY();
}
ancX = totX / linkedAllies.size();
ancY = totY / linkedAllies.size();
}
if (ancInAction) {
// Anker wird schon beansprucht.
if (anchorReached()) {
ancInAction = false;
return false; // Angekommen. Aufheben.
} else {
move();
return true;
}
} else { // Noch kein Anker in Aktion
if (anchorCallNeeded()) { // Anker in Aktion benötigt
ancInAction = true;
ancAimX = ancX + rand(ancRadian * 2) - ancRadian;
ancAimY = ancY + rand(ancRadian * 2) - ancRadian;
getHost().getVelocity().aimFor(getHost().getLocX(), getHost().getLocY(), getHost().getSpeed(), ancAimX,
ancAimY);
move();
return true;
} else // Nix benötigt
return false;
}
}
@Override
public void setDamageRecognizeable() {
DamageCall call = new DamageCall() {
@Override
public void damage(CombatObject source, Projectile proj, int dmg) {
// Zur Quelle gehen, falls lockon nicht schon vorhanden
if (getLockOn() != null)
return;
if (anchored) // Im Anker-Prozess nicht umdrehen
return;
// Distanz prüfen
if (!source.isInRange(getHost(), getLockPhysicalDetectionRange()))
return;
if (source == MainZap.getPlayer() && getHost().isFriend())
return; // Friendly-Fire
// Alle Bedingungen erfüllt
if (isParked()) // Park-Bremse aufheben
setParked(false);
setLockOn(source);
getHost().setShootingAim(source);
}
};
addCall(KEY_CALL_GETTING_DAMAGED, call);
}
private boolean anchorCallNeeded() {
if (Grid.distance(new Point(getHost().getLocX(), getHost().getLocY()), new Point(ancX, ancY)) < ancRange)
return false; // Noch in Range
if (rand(ancRandReturn) == 0)
return true; // Trotz Out-Of-Range noch warten
// Out of range und keine Ausnahme.
return false;
}
private boolean anchorReached() {
if (Grid.distance(new Point(getHost().getLocX(), getHost().getLocY()), new Point(ancX, ancY)) < ancRadian)
return true; // Im Radius
return false; // Nicht im Radius...
}
// Anker aufheben
public void removeAnchor() {
anchored = false;
ancInAction = false;
}
// Anker setzen
public void anchor(int x, int y, int ancRadian, int maxDistance, int returnRand) {
ancX = x;
ancY = y;
ancRange = maxDistance;
this.ancRadian = ancRadian;
ancRandReturn = returnRand;
anchored = true;
ancInAction = false;
}
public void setEnableCrowdAnchor(boolean enable) {
ancCrowdEnabled = enable;
}
// -------------
protected void move() {
getHost().moveX(getHost().getVelocity().getX());
getHost().moveY(getHost().getVelocity().getY());
}
public ArrayList<CombatObject> getLinkedAllies() {
return linkedAllies;
}
public void setLinkedAllies(ArrayList<CombatObject> linkedAllies) {
this.linkedAllies = linkedAllies;
}
public ArrayList<CombatObject> getLinkedEnemys() {
return linkedEnemys;
}
public void setLinkedEnemys(ArrayList<CombatObject> linkedEnemys) {
this.linkedEnemys = linkedEnemys;
}
public int getAncX() {
return ancX;
}
public void setAncX(int ancX) {
this.ancX = ancX;
}
public int getAncY() {
return ancY;
}
public void setAncY(int ancY) {
this.ancY = ancY;
}
public int getAncRange() {
return ancRange;
}
public void setAncRange(int ancRange) {
this.ancRange = ancRange;
}
public int getAncRandReturn() {
return ancRandReturn;
}
public void setAncRandReturn(int ancRandReturn) {
this.ancRandReturn = ancRandReturn;
}
public int getAncRadian() {
return ancRadian;
}
public void setAncRadian(int ancRadian) {
this.ancRadian = ancRadian;
}
public int getAncAimX() {
return ancAimX;
}
public void setAncAimX(int ancAimX) {
this.ancAimX = ancAimX;
}
public int getAncAimY() {
return ancAimY;
}
public void setAncAimY(int ancAimY) {
this.ancAimY = ancAimY;
}
public FindLockAction getLockAction() {
return lockAction;
}
public void setLockAction(FindLockAction lockAction) {
this.lockAction = lockAction;
}
public Rectangle getMovementBounds() {
return movementBounds;
}
public void setMovementBounds(Rectangle movementBounds) {
this.movementBounds = movementBounds;
}
public int getLockCombatFreeMovementRange() {
return lockCombatFreeMovementRange;
}
public void setLockCombatFreeMovementRange(int lockCombatFreeMovementRange) {
this.lockCombatFreeMovementRange = lockCombatFreeMovementRange;
}
public float getCombatRangePerOutOfRangeRange() {
return combatRangePerOutOfRangeRange;
}
public void setCombatRangePerOutOfRangeRange(float combatRangePerOutOfRangeRange) {
this.combatRangePerOutOfRangeRange = combatRangePerOutOfRangeRange;
}
public boolean isAnchored() {
return anchored;
}
public boolean isAncInAction() {
return ancInAction;
}
public boolean isAncCrowdEnabled() {
return ancCrowdEnabled;
}
public boolean isNoAlternativeLock() {
return noAlternativeLock;
}
public void setNoAlternativeLock(boolean noAlternativeLock) {
this.noAlternativeLock = noAlternativeLock;
}
@Override
public Object getClone() {
return new AdvancedSingleProtocol();
}
}
| 17,489 | 0.672523 | 0.667086 | 606 | 26.833334 | 25.915773 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.308581 | false | false | 0 |
211184f902c1bbce8b6d75e2721d27da282df94b | 15,195,594,304,444 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Spring/Spring3140.java | 1f7960a4dd6e73e13e627ed348aa614f1eeebb18 | []
| no_license | saber13812002/DeepCRM | https://github.com/saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473000 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | @Test
public void getBeanByTypeAmbiguityRaisesException() {
ApplicationContext context = new AnnotationConfigApplicationContext(TwoTestBeanConfig.class);
try {
context.getBean(TestBean.class);
}
catch (NoSuchBeanDefinitionException ex) {
assertThat(ex.getMessage(),
allOf(
containsString("No qualifying bean of type '" + TestBean.class.getName() + "'"),
containsString("tb1"),
containsString("tb2")
)
);
}
}
| UTF-8 | Java | 460 | java | Spring3140.java | Java | []
| null | []
| @Test
public void getBeanByTypeAmbiguityRaisesException() {
ApplicationContext context = new AnnotationConfigApplicationContext(TwoTestBeanConfig.class);
try {
context.getBean(TestBean.class);
}
catch (NoSuchBeanDefinitionException ex) {
assertThat(ex.getMessage(),
allOf(
containsString("No qualifying bean of type '" + TestBean.class.getName() + "'"),
containsString("tb1"),
containsString("tb2")
)
);
}
}
| 460 | 0.691304 | 0.686957 | 17 | 26 | 28.396355 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.294118 | false | false | 0 |
17e3bf5b7bb20000d610e9a26c96b064cf0469ed | 1,537,598,327,668 | abb25245e3d743a28c2e7221cbe5ce2a68150123 | /ecommerce-sdk/src/main/java/com/ecommerce/sdk/request/RegisterBuyerRequestDTO.java | 1af971a4b2446853638ba6dea64f67ae7446edb6 | [
"Apache-2.0"
]
| permissive | atiountchik/ecommerce-microservices | https://github.com/atiountchik/ecommerce-microservices | 9e072231ca27bae494a8cc4ff6e6b83934b7fae1 | 4397e2f889a3d810ddd77f10e6140c924f37c048 | refs/heads/main | 2023-08-30T21:32:18.915000 | 2021-10-19T14:21:54 | 2021-10-19T14:21:54 | 415,716,697 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ecommerce.sdk.request;
import com.ecommerce.sdk.enums.CountryEnum;
import javax.validation.constraints.*;
import java.util.Objects;
public class RegisterBuyerRequestDTO {
@Email
private String email;
@NotBlank
private String password;
private CountryEnum country;
@NotBlank
@Size(max = 200)
private String name;
@DecimalMin("-90.0")
@DecimalMax("90.0")
@NotNull
private Double latitude;
@DecimalMin("-180.0")
@DecimalMax("180.0")
@NotNull
private Double longitude;
public RegisterBuyerRequestDTO(String email, String password, CountryEnum country, String name, Double latitude, Double longitude) {
this.email = email;
this.password = password;
this.country = country;
this.name = name;
this.latitude = latitude;
this.longitude = longitude;
}
public RegisterBuyerRequestDTO() {
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public CountryEnum getCountry() {
return country;
}
public void setCountry(CountryEnum country) {
this.country = country;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RegisterBuyerRequestDTO that = (RegisterBuyerRequestDTO) o;
return Objects.equals(email, that.email) && Objects.equals(password, that.password) && country == that.country && Objects.equals(name, that.name) && Objects.equals(latitude, that.latitude) && Objects.equals(longitude, that.longitude);
}
@Override
public int hashCode() {
return Objects.hash(email, password, country, name, latitude, longitude);
}
}
| UTF-8 | Java | 2,425 | java | RegisterBuyerRequestDTO.java | Java | [
{
"context": " this.email = email;\n this.password = password;\n this.country = country;\n this.nam",
"end": 745,
"score": 0.9978368282318115,
"start": 737,
"tag": "PASSWORD",
"value": "password"
},
{
"context": "assword(String password) {\n this.password = password;\n }\n\n public CountryEnum getCountry() {\n ",
"end": 1209,
"score": 0.9913836717605591,
"start": 1201,
"tag": "PASSWORD",
"value": "password"
},
{
"context": "nt hashCode() {\n return Objects.hash(email, password, country, name, latitude, longitude);\n }\n}\n",
"end": 2378,
"score": 0.6607747077941895,
"start": 2370,
"tag": "PASSWORD",
"value": "password"
}
]
| null | []
| package com.ecommerce.sdk.request;
import com.ecommerce.sdk.enums.CountryEnum;
import javax.validation.constraints.*;
import java.util.Objects;
public class RegisterBuyerRequestDTO {
@Email
private String email;
@NotBlank
private String password;
private CountryEnum country;
@NotBlank
@Size(max = 200)
private String name;
@DecimalMin("-90.0")
@DecimalMax("90.0")
@NotNull
private Double latitude;
@DecimalMin("-180.0")
@DecimalMax("180.0")
@NotNull
private Double longitude;
public RegisterBuyerRequestDTO(String email, String password, CountryEnum country, String name, Double latitude, Double longitude) {
this.email = email;
this.password = <PASSWORD>;
this.country = country;
this.name = name;
this.latitude = latitude;
this.longitude = longitude;
}
public RegisterBuyerRequestDTO() {
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = <PASSWORD>;
}
public CountryEnum getCountry() {
return country;
}
public void setCountry(CountryEnum country) {
this.country = country;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RegisterBuyerRequestDTO that = (RegisterBuyerRequestDTO) o;
return Objects.equals(email, that.email) && Objects.equals(password, that.password) && country == that.country && Objects.equals(name, that.name) && Objects.equals(latitude, that.latitude) && Objects.equals(longitude, that.longitude);
}
@Override
public int hashCode() {
return Objects.hash(email, <PASSWORD>, country, name, latitude, longitude);
}
}
| 2,431 | 0.634639 | 0.627629 | 101 | 23.009901 | 30.195566 | 242 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.49505 | false | false | 0 |
c4ae7f9549f0a307bf7871fa1aaffcab1b042448 | 17,506,286,714,080 | 3977f587bd268f2fb898b444b72d105cede44bcc | /java/updateStudentPassword.java | 99ca40ec358ddf73182480994c69beb76abc3cc3 | []
| no_license | grpranto/Aider---Web-Application | https://github.com/grpranto/Aider---Web-Application | c3fe6b7232ee3ce726d7a4a039e6cec57f79dce9 | ad287b8ba0f5b878d3cf5aafc075485a7c339cf5 | refs/heads/master | 2020-05-17T16:42:50.107000 | 2019-04-27T22:47:16 | 2019-04-27T22:47:16 | 183,828,127 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.Part;
@MultipartConfig
public class updateStudentPassword extends HttpServlet {
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
//String name, roll, email, pass, confirmPass, institution, phone, guardianPhone, location, photo;
//long p, g;
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
String email = session.getAttribute("email").toString();
String pass = request.getParameter("pass");
String title = "";
Connection conn = null;
//SESSION
/*if(session.isNew()){
title = "Newbie";
}
else{
title = "Welcome";
}*/
//out.println("EMAIL = "+email);
try{
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", "root", "");
PreparedStatement ps = conn.prepareStatement("update student1 set pass=? where email=?");
ps.setString(1, pass);
ps.setString(2, email);
//ResultSet rs = ps.executeQuery();
int count = ps.executeUpdate();
if(count > 0){
request.getRequestDispatcher("success1.jsp").forward(request, response);
if (session != null) {
session.invalidate();
}
}
else{
request.getRequestDispatcher("error.jsp").forward(request, response);
}
}
catch(Exception e){
e.printStackTrace();
}
finally{
out.println(title);
}
try {
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 2,567 | java | updateStudentPassword.java | Java | []
| null | []
| import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.Part;
@MultipartConfig
public class updateStudentPassword extends HttpServlet {
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
//String name, roll, email, pass, confirmPass, institution, phone, guardianPhone, location, photo;
//long p, g;
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
String email = session.getAttribute("email").toString();
String pass = request.getParameter("pass");
String title = "";
Connection conn = null;
//SESSION
/*if(session.isNew()){
title = "Newbie";
}
else{
title = "Welcome";
}*/
//out.println("EMAIL = "+email);
try{
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", "root", "");
PreparedStatement ps = conn.prepareStatement("update student1 set pass=? where email=?");
ps.setString(1, pass);
ps.setString(2, email);
//ResultSet rs = ps.executeQuery();
int count = ps.executeUpdate();
if(count > 0){
request.getRequestDispatcher("success1.jsp").forward(request, response);
if (session != null) {
session.invalidate();
}
}
else{
request.getRequestDispatcher("error.jsp").forward(request, response);
}
}
catch(Exception e){
e.printStackTrace();
}
finally{
out.println(title);
}
try {
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| 2,567 | 0.562914 | 0.559408 | 82 | 29.304878 | 24.766071 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.707317 | false | false | 0 |
354166ad7bc779b0e30371b608f7cd0eaf41db83 | 24,988,119,745,515 | ea4771fcc198a5c003ca69833f6c63563716b033 | /src/main/java/org/dimitrovchi/maptest/stat/StatObject.java | 9ff7cfbb347a39b7679a557a7540a9b81157d9d4 | []
| no_license | dimitrovchi/maptest | https://github.com/dimitrovchi/maptest | 067e3e99d0a14d5e71a4b4c7b97d28788ae64482 | d32986c056f5f760ef95ac41513568df60de320e | refs/heads/master | 2021-05-16T02:08:30.238000 | 2017-06-30T06:53:13 | 2017-06-30T06:53:13 | 7,974,890 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.dimitrovchi.maptest.stat;
/**
* @author Dmitry Ovchinnikov
*/
public class StatObject {
private final int id;
public StatObject(int id) {
this.id = id;
}
@Override
public int hashCode() {
return id;
}
@Override
public boolean equals(Object obj) {
return obj == this || obj != null && obj.getClass() == getClass() && ((StatObject) obj).id == id;
}
}
| UTF-8 | Java | 428 | java | StatObject.java | Java | [
{
"context": "kage org.dimitrovchi.maptest.stat;\n\n/**\n * @author Dmitry Ovchinnikov\n */\npublic class StatObject {\n\n private final ",
"end": 72,
"score": 0.9995465874671936,
"start": 54,
"tag": "NAME",
"value": "Dmitry Ovchinnikov"
}
]
| null | []
| package org.dimitrovchi.maptest.stat;
/**
* @author <NAME>
*/
public class StatObject {
private final int id;
public StatObject(int id) {
this.id = id;
}
@Override
public int hashCode() {
return id;
}
@Override
public boolean equals(Object obj) {
return obj == this || obj != null && obj.getClass() == getClass() && ((StatObject) obj).id == id;
}
}
| 416 | 0.577103 | 0.577103 | 23 | 17.608696 | 22.613461 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.304348 | false | false | 0 |
1ad85626809db3dfcbc0a24b1fefe49948812b54 | 33,921,651,708,208 | 012dbc987629ca4a378d4526b792aa2d79168120 | /src/main/java/com/invigorate/pages/AddNewPayer.java | 63cbf5715e7910cb8c8bb95b4ba87f2e9b38a03c | []
| no_license | piyoosha02/Alveo-Automation | https://github.com/piyoosha02/Alveo-Automation | 2e6fceea43c20a205637b57dcce9eb1656a75c5e | 94b2dc900adeb3571771fdaf83c9fab73ae04502 | refs/heads/master | 2020-03-09T16:11:54.369000 | 2018-04-10T06:10:27 | 2018-04-10T06:10:27 | 128,878,398 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.invigorate.pages;
public class AddNewPayer {
}
| UTF-8 | Java | 61 | java | AddNewPayer.java | Java | []
| null | []
| package com.invigorate.pages;
public class AddNewPayer {
}
| 61 | 0.770492 | 0.770492 | 5 | 11.2 | 13.347659 | 29 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 0 |
6363a96acc9decf7d019869a37d115856a4c8dcf | 31,619,549,253,873 | 1ecc142ffa2342404efe85a8e6df48d22bc87151 | /src/main/java/com/egen/orderservice/dto/OrderRequest.java | 1f689ff324a6e5d84850738f7371d591f80a3503 | []
| no_license | darshanvyadav/orderservice | https://github.com/darshanvyadav/orderservice | 71ac0e9a40143cadf0e540340826f689f399c8c4 | 3736300c5fa6a57f97ae93abae55852b7eef9dfb | refs/heads/main | 2023-01-10T13:09:54.556000 | 2020-11-10T19:16:21 | 2020-11-10T19:16:21 | 309,792,280 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.egen.orderservice.dto;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import com.egen.orderservice.model.OrderBillingAddress;
import com.egen.orderservice.model.OrderItemDetails;
import com.egen.orderservice.model.OrderPaymentDetails;
import com.egen.orderservice.model.OrderPaymnetTransaction;
import com.egen.orderservice.model.OrderShippingAddress;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderRequest implements Serializable {
private static final long serialVersionUID = 1L;
private UUID orderId;
@NotNull(message = "orderStatus is null")
private String orderStatus;
@NotNull(message = "CustomerId is null")
private String orderCustomerId;
@NotNull(message = "items is null")
private List<OrderItemDetails> items;
@NotNull(message = "shippingMethod is null")
private String shippingMethod;
@NotNull(message = "PaymentDetails is null")
private OrderPaymentDetails orderPaymentDetails;
@NotNull(message = "ShippingAddress is null")
private OrderShippingAddress orderShippingAddress;
@NotNull(message = "BillingAddress is null")
private OrderBillingAddress orderBillingAddress;
@NotNull(message = "PaymnetTransaction details is null")
private Set<OrderPaymnetTransaction> orderPaymnetTransaction;
@Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
return "error converting object in to string";
}
}
} | UTF-8 | Java | 1,789 | java | OrderRequest.java | Java | []
| null | []
| package com.egen.orderservice.dto;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import com.egen.orderservice.model.OrderBillingAddress;
import com.egen.orderservice.model.OrderItemDetails;
import com.egen.orderservice.model.OrderPaymentDetails;
import com.egen.orderservice.model.OrderPaymnetTransaction;
import com.egen.orderservice.model.OrderShippingAddress;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderRequest implements Serializable {
private static final long serialVersionUID = 1L;
private UUID orderId;
@NotNull(message = "orderStatus is null")
private String orderStatus;
@NotNull(message = "CustomerId is null")
private String orderCustomerId;
@NotNull(message = "items is null")
private List<OrderItemDetails> items;
@NotNull(message = "shippingMethod is null")
private String shippingMethod;
@NotNull(message = "PaymentDetails is null")
private OrderPaymentDetails orderPaymentDetails;
@NotNull(message = "ShippingAddress is null")
private OrderShippingAddress orderShippingAddress;
@NotNull(message = "BillingAddress is null")
private OrderBillingAddress orderBillingAddress;
@NotNull(message = "PaymnetTransaction details is null")
private Set<OrderPaymnetTransaction> orderPaymnetTransaction;
@Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
return "error converting object in to string";
}
}
} | 1,789 | 0.806037 | 0.805478 | 65 | 26.538462 | 21.332588 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.984615 | false | false | 0 |
3525ff8a9633cc913aedab72cb1820a797fa6775 | 34,668,976,014,960 | b85b65df086ed15889e769ea39517857fd92258a | /yhb-dao/src/main/java/com/lrcf/yhb/dao/mapper/ExperienceSendDao.java | cceef9b480cc851ee4b74fd4de6633208d118dfa | []
| no_license | moutainhigh/lrcf | https://github.com/moutainhigh/lrcf | 4100e1e823ccd8faa2726725fca7fac4d88fd4ec | 4c5cde3d4c2b02afb6bfb00cab5078533e54089b | refs/heads/master | 2021-01-02T03:05:39.153000 | 2017-09-14T08:38:14 | 2017-09-14T08:38:14 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lrcf.yhb.dao.mapper;
import com.lrcf.yhb.pojo.ExperienceSend;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface ExperienceSendDao {
int deleteByPrimaryKey(Integer experiencesendid);
int insert(ExperienceSend record);
int insertSelective(ExperienceSend record);
List<ExperienceSend> selectExperienceSendList(Map param);
ExperienceSend selectByPrimaryKey(Integer experiencesendid);
List<ExperienceSend> getExperience(Map param);
int countExperienceSend(Map param);
int updateByPrimaryKeySelective(ExperienceSend record);
int updateByPrimaryKeyWithBLOBs(ExperienceSend record);
int updateByPrimaryKey(ExperienceSend record);
} | UTF-8 | Java | 743 | java | ExperienceSendDao.java | Java | []
| null | []
| package com.lrcf.yhb.dao.mapper;
import com.lrcf.yhb.pojo.ExperienceSend;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface ExperienceSendDao {
int deleteByPrimaryKey(Integer experiencesendid);
int insert(ExperienceSend record);
int insertSelective(ExperienceSend record);
List<ExperienceSend> selectExperienceSendList(Map param);
ExperienceSend selectByPrimaryKey(Integer experiencesendid);
List<ExperienceSend> getExperience(Map param);
int countExperienceSend(Map param);
int updateByPrimaryKeySelective(ExperienceSend record);
int updateByPrimaryKeyWithBLOBs(ExperienceSend record);
int updateByPrimaryKey(ExperienceSend record);
} | 743 | 0.794078 | 0.794078 | 29 | 24.655172 | 24.08931 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.517241 | false | false | 0 |
ad99267d6a3d4a6cce56eef6cb4ffdfffefa8858 | 34,668,976,017,287 | d39817a17e6b62a67ba46cd3d6e27f27d402be9a | /BookManager/src/main/java/Dao/ValueObject/Book.java | cf6e385559bedcc166ae84cab5a108050d011e39 | []
| no_license | zhuyidi/book_manager | https://github.com/zhuyidi/book_manager | 563dac320e55fcc39191d246b45caf572310ab93 | 72541ea06ab7ed3438eda067cadbeec2ba2f44e4 | refs/heads/master | 2021-01-02T08:15:28.501000 | 2017-08-03T07:31:05 | 2017-08-03T07:31:05 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Dao.ValueObject;
/**
* Created by dela on 7/20/17.
*/
public class Book {
private int id;
private String name;
private String author;
private String owner;
private int amount;
private String upload_date;
private String describe;
private int borrow_num;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public String getUpload_date() {
return upload_date;
}
public void setUpload_date(String upload_date) {
this.upload_date = upload_date;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public int getBorrow_num() {
return borrow_num;
}
public void setBorrow_num(int borrow_num) {
this.borrow_num = borrow_num;
}
}
| UTF-8 | Java | 1,442 | java | Book.java | Java | [
{
"context": "package Dao.ValueObject;\n\n\n/**\n * Created by dela on 7/20/17.\n */\npublic class Book {\n private i",
"end": 49,
"score": 0.9520190358161926,
"start": 45,
"tag": "USERNAME",
"value": "dela"
}
]
| null | []
| package Dao.ValueObject;
/**
* Created by dela on 7/20/17.
*/
public class Book {
private int id;
private String name;
private String author;
private String owner;
private int amount;
private String upload_date;
private String describe;
private int borrow_num;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public String getUpload_date() {
return upload_date;
}
public void setUpload_date(String upload_date) {
this.upload_date = upload_date;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public int getBorrow_num() {
return borrow_num;
}
public void setBorrow_num(int borrow_num) {
this.borrow_num = borrow_num;
}
}
| 1,442 | 0.579057 | 0.575589 | 81 | 16.802469 | 14.902497 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.308642 | false | false | 0 |
d1445cc89165c873bc8fbc204f7dd3805c4494ae | 34,634,616,277,775 | f76f1f306c7f68c34e8edc0225a1d404a0aa3897 | /app/src/main/java/com/flurry/org/codehaus/jackson/map/JsonDeserializer.java | f555d3ccc94acef227b48e1a6d797d9e9532b8d4 | []
| no_license | Bingle-labake/Vine15 | https://github.com/Bingle-labake/Vine15 | b8a2852bf43e295a63c976d2fa263b301036807d | b75665ff848df0d526ec0f26d64516629c150b33 | refs/heads/master | 2016-09-01T05:59:05.804000 | 2015-10-31T07:40:04 | 2015-10-31T07:40:04 | 45,291,739 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.flurry.org.codehaus.jackson.map;
import com.flurry.org.codehaus.jackson.JsonParser;
import com.flurry.org.codehaus.jackson.JsonProcessingException;
import java.io.IOException;
public abstract class JsonDeserializer<T>
{
public abstract T deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException;
public T deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, T paramT)
throws IOException, JsonProcessingException
{
throw new UnsupportedOperationException();
}
public Object deserializeWithType(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, TypeDeserializer paramTypeDeserializer)
throws IOException, JsonProcessingException
{
return paramTypeDeserializer.deserializeTypedFromAny(paramJsonParser, paramDeserializationContext);
}
public T getEmptyValue()
{
return getNullValue();
}
public T getNullValue()
{
return null;
}
public JsonDeserializer<T> unwrappingDeserializer()
{
return this;
}
public static abstract class None extends JsonDeserializer<Object>
{
}
}
/* Location: /Users/dantheman/src/android/decompiled/vine-decompiled/dex2jar/classes-dex2jar.jar
* Qualified Name: com.flurry.org.codehaus.jackson.map.JsonDeserializer
* JD-Core Version: 0.6.2
*/ | UTF-8 | Java | 1,420 | java | JsonDeserializer.java | Java | []
| null | []
| package com.flurry.org.codehaus.jackson.map;
import com.flurry.org.codehaus.jackson.JsonParser;
import com.flurry.org.codehaus.jackson.JsonProcessingException;
import java.io.IOException;
public abstract class JsonDeserializer<T>
{
public abstract T deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException;
public T deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, T paramT)
throws IOException, JsonProcessingException
{
throw new UnsupportedOperationException();
}
public Object deserializeWithType(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, TypeDeserializer paramTypeDeserializer)
throws IOException, JsonProcessingException
{
return paramTypeDeserializer.deserializeTypedFromAny(paramJsonParser, paramDeserializationContext);
}
public T getEmptyValue()
{
return getNullValue();
}
public T getNullValue()
{
return null;
}
public JsonDeserializer<T> unwrappingDeserializer()
{
return this;
}
public static abstract class None extends JsonDeserializer<Object>
{
}
}
/* Location: /Users/dantheman/src/android/decompiled/vine-decompiled/dex2jar/classes-dex2jar.jar
* Qualified Name: com.flurry.org.codehaus.jackson.map.JsonDeserializer
* JD-Core Version: 0.6.2
*/ | 1,420 | 0.788732 | 0.785211 | 47 | 29.234043 | 37.663242 | 155 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.404255 | false | false | 0 |
5f987d81c998c1793be0fdc5186fc5f5d67aee1b | 34,634,616,275,705 | fe08cf9d0c20181250f1d4ca3910c9c3ead4c585 | /module/core/src/main/java/zut/cs/core/service/impl/ComponentManagerImpl.java | 25f76452fb8e94a4b11046cde92bda94df415140 | []
| no_license | zut-huangtang/zutnp_paltform | https://github.com/zut-huangtang/zutnp_paltform | 7d1c97bd889192ed2048baf4613702e6f5d8e7b9 | 47277aa20a0aaaaa2d5fe33c4841a0efc721d7fc | refs/heads/master | 2020-08-10T20:55:36.237000 | 2019-10-11T08:12:48 | 2019-10-11T08:12:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package zut.cs.core.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import zut.cs.core.base.service.impl.GenericManagerImpl;
import zut.cs.core.dao.ComponentDao;
import zut.cs.core.domain.Component;
import zut.cs.core.domain.User;
import zut.cs.core.service.ComponentManager;
import java.util.List;
import java.util.Set;
@Service
public class ComponentManagerImpl extends GenericManagerImpl<Component, Long> implements ComponentManager {
ComponentDao componentDao;
@Autowired
public void setComponentDao(ComponentDao componentDao) {
this.componentDao = componentDao;
this.dao = this.componentDao;
}
@Override
public Set<Component> findByUser(User user) {
return componentDao.findByUser(user);
}
}
| UTF-8 | Java | 830 | java | ComponentManagerImpl.java | Java | []
| null | []
| package zut.cs.core.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import zut.cs.core.base.service.impl.GenericManagerImpl;
import zut.cs.core.dao.ComponentDao;
import zut.cs.core.domain.Component;
import zut.cs.core.domain.User;
import zut.cs.core.service.ComponentManager;
import java.util.List;
import java.util.Set;
@Service
public class ComponentManagerImpl extends GenericManagerImpl<Component, Long> implements ComponentManager {
ComponentDao componentDao;
@Autowired
public void setComponentDao(ComponentDao componentDao) {
this.componentDao = componentDao;
this.dao = this.componentDao;
}
@Override
public Set<Component> findByUser(User user) {
return componentDao.findByUser(user);
}
}
| 830 | 0.771084 | 0.771084 | 28 | 28.642857 | 25.023153 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.535714 | false | false | 0 |
77a1b7c06d68bcfd887556b6507f6ae7c20e173a | 11,785,390,314,652 | aa02b1656b8340379658415e86f642c30a011565 | /cbrmb_demo_new/src/main/java/com/gopay/cbrmb/modules/demo/dto/PayResDTO.java | 87559e5ff426b594df5847ee2ffed3f0dc317863 | []
| no_license | cuigudong/clxy | https://github.com/cuigudong/clxy | 27bf9835ebba113160ca8846ab561ff906a91045 | 64ccf50893581cb537aa8db7f7aa8bae9a58e8e8 | refs/heads/master | 2018-01-08T21:31:27.053000 | 2016-12-21T06:30:51 | 2016-12-21T06:30:51 | 44,092,040 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
*/
package com.gopay.cbrmb.modules.demo.dto;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author junjie.ge
*
*/
public class PayResDTO implements Serializable {
private static final long serialVersionUID = -5502891171783045401L;
private Boolean isSuccess;
private String msg;
private String errorType;
private BigDecimal transAmount;
private String payMode;
private BigDecimal customerBalance;
private List<PayResOrderDTO> payOrders;
/**
* @return the isSuccess
*/
public Boolean getIsSuccess() {
return isSuccess;
}
/**
* @param isSuccess the isSuccess to set
*/
public void setIsSuccess(Boolean isSuccess) {
this.isSuccess = isSuccess;
}
/**
* @return the msg
*/
public String getMsg() {
return msg;
}
/**
* @param msg the msg to set
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
* @return the transAmount
*/
public BigDecimal getTransAmount() {
return transAmount;
}
/**
* @param transAmount the transAmount to set
*/
public void setTransAmount(BigDecimal transAmount) {
this.transAmount = transAmount;
}
/**
* @return the payMode
*/
public String getPayMode() {
return payMode;
}
/**
* @param payMode the payMode to set
*/
public void setPayMode(String payMode) {
this.payMode = payMode;
}
/**
* @return the customerBalance
*/
public BigDecimal getCustomerBalance() {
return customerBalance;
}
/**
* @param customerBalance the customerBalance to set
*/
public void setCustomerBalance(BigDecimal customerBalance) {
this.customerBalance = customerBalance;
}
/**
* @return the payOrders
*/
public List<PayResOrderDTO> getPayOrders() {
return payOrders;
}
/**
* @param payOrders the payOrders to set
*/
public void setPayOrders(List<PayResOrderDTO> payOrders) {
this.payOrders = payOrders;
}
/**
* @return the errorType
*/
public String getErrorType() {
return errorType;
}
/**
* @param errorType the errorType to set
*/
public void setErrorType(String errorType) {
this.errorType = errorType;
}
}
| UTF-8 | Java | 2,214 | java | PayResDTO.java | Java | [
{
"context": "ecimal;\r\nimport java.util.List;\r\n\r\n/**\r\n * @author junjie.ge\r\n *\r\n */\r\npublic class PayResDTO implements Seria",
"end": 171,
"score": 0.996499240398407,
"start": 162,
"tag": "USERNAME",
"value": "junjie.ge"
}
]
| null | []
| /**
*
*/
package com.gopay.cbrmb.modules.demo.dto;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author junjie.ge
*
*/
public class PayResDTO implements Serializable {
private static final long serialVersionUID = -5502891171783045401L;
private Boolean isSuccess;
private String msg;
private String errorType;
private BigDecimal transAmount;
private String payMode;
private BigDecimal customerBalance;
private List<PayResOrderDTO> payOrders;
/**
* @return the isSuccess
*/
public Boolean getIsSuccess() {
return isSuccess;
}
/**
* @param isSuccess the isSuccess to set
*/
public void setIsSuccess(Boolean isSuccess) {
this.isSuccess = isSuccess;
}
/**
* @return the msg
*/
public String getMsg() {
return msg;
}
/**
* @param msg the msg to set
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
* @return the transAmount
*/
public BigDecimal getTransAmount() {
return transAmount;
}
/**
* @param transAmount the transAmount to set
*/
public void setTransAmount(BigDecimal transAmount) {
this.transAmount = transAmount;
}
/**
* @return the payMode
*/
public String getPayMode() {
return payMode;
}
/**
* @param payMode the payMode to set
*/
public void setPayMode(String payMode) {
this.payMode = payMode;
}
/**
* @return the customerBalance
*/
public BigDecimal getCustomerBalance() {
return customerBalance;
}
/**
* @param customerBalance the customerBalance to set
*/
public void setCustomerBalance(BigDecimal customerBalance) {
this.customerBalance = customerBalance;
}
/**
* @return the payOrders
*/
public List<PayResOrderDTO> getPayOrders() {
return payOrders;
}
/**
* @param payOrders the payOrders to set
*/
public void setPayOrders(List<PayResOrderDTO> payOrders) {
this.payOrders = payOrders;
}
/**
* @return the errorType
*/
public String getErrorType() {
return errorType;
}
/**
* @param errorType the errorType to set
*/
public void setErrorType(String errorType) {
this.errorType = errorType;
}
}
| 2,214 | 0.65944 | 0.650858 | 109 | 18.311926 | 17.179941 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.229358 | false | false | 0 |
d5e89fdb953efdb1685e51517108f1523062e27e | 7,584,912,269,259 | aa3d39b93f0327d6fa4e00ebbde0f923ef1271f2 | /src/main/java/com/web/store/service/impl/ProductServiecImpl.java | 9138dcb3c0c8999f39e7a4136f2a3f286dee8a64 | []
| no_license | vincent0702/imovie | https://github.com/vincent0702/imovie | eb433ab566e87eac918f1cddc637041fecdecf2f | dd9a65007cefa84e1772f67eec5d842eda2512d9 | refs/heads/master | 2022-12-02T05:12:24.309000 | 2020-08-11T05:31:23 | 2020-08-11T05:31:23 | 286,655,021 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.web.store.service.impl;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.web.store.dao.ProductDao;
import com.web.store.model.CartOrderBean;
import com.web.store.model.CartOrderFood;
import com.web.store.model.FoodBean;
import com.web.store.model.FoodBeanWithImageData;
import com.web.store.model.Food_Genre;
import com.web.store.model.HomeBeanWithImageData;
import com.web.store.model.MovieBean;
import com.web.store.model.MovieBeanWithImageData;
import com.web.store.model.Movie_Genre;
import com.web.store.model.RoomBean;
import com.web.store.model.RoomBeanWithImageData;
import com.web.store.model.SurveyBean;
import com.web.store.service.ProductServiec;
@Service
public class ProductServiecImpl implements ProductServiec {
@Autowired
ProductDao productDao;
//Food
@Transactional
@Override
public List<FoodBean> getAllProducts() {
return productDao.getAllProducts();
}
@Transactional
@Override
public List<String> getAllCategories() {
return productDao.getAllCategories();
}
@Transactional
@Override
public List<FoodBean> getFoodByCategory(String category) {
return productDao.getFoodByCategory(category);
}
@Transactional
@Override
public FoodBean getProductById(int productId) {
return productDao.getProductById(productId);
}
//movie方法
@Transactional
@Override
public List<MovieBean> getAllProducts1() {
return productDao.getAllProducts1();
}
@Transactional
@Override
public List<String> getAllCategories1() {
return productDao.getAllCategories1();
}
@Transactional
@Override
public List<MovieBean> getProductsByCategory1(String category) {
return productDao.getProductsByCategory1(category);
}
@Transactional
@Override
public MovieBean getProductById1(int productId) {
return productDao.getProductById1(productId);
}
//Room
@Transactional
@Override
public List<RoomBean> getAllProducts2() {
return productDao.getAllProducts2();
}
@Transactional
@Override
public List<String> getAllCategories2() {
return productDao.getAllCategories2();
}
@Transactional
@Override
public List<RoomBean> getProductsByCategory2(String category) {
return productDao.getProductsByCategory2(category);
}
@Transactional
@Override
public RoomBean getProductById2(int productId) {
return productDao.getProductById2(productId);
}
@Transactional
@Override
public List<FoodBeanWithImageData> getAllFoodsWithImageData() {
return productDao.getAllFoodsWithImageData();
}
@Transactional
@Override
public List<MovieBeanWithImageData> getAllMoviesWithImageData() {
return productDao.getAllMoviesWithImageData();
}
@Transactional
@Override
public List<RoomBeanWithImageData> getAllRoomsWithImageData() {
return productDao.getAllRoomsWithImageData();
}
@Transactional
@Override
public List<FoodBean> getFoodType() {
return productDao.getFoodType();
}
@Transactional
@Override
public List<FoodBean> getSelectfoodTypes() {
return productDao.getSelectfoodTypes();
}
@Transactional
@Override
public List<FoodBean> getSelectfoods(Integer foodTypeId) {
return productDao.getSelectfoods(foodTypeId);
}
@Transactional
@Override
public List<MovieBean> getSelectmovies(Integer movieTypeId) {
return productDao.getSelectmovies(movieTypeId);
}
@Transactional
@Override
public List<MovieBean> getSelectmovieTypes() {
return productDao.getSelectmovieTypes();
}
@Transactional
@Override
public List<RoomBean> getSelectrooms(Integer roomNameId) {
return productDao.getSelectrooms(roomNameId);
}
@Transactional
@Override
public List<RoomBean> getSelectroomTypes() {
return productDao.getSelectroomTypes();
}
@Transactional
@Override
public void cartToDB(CartOrderBean cob) {
productDao.cartToDB(cob);
}
@Transactional
@Override
public boolean checkOrderTime(int orderRoomId, String checkDay, String checkStart, String checkEnd)
throws ParseException {
return productDao.checkOrderTime(orderRoomId,checkDay,checkStart,checkEnd);
}
@Transactional
@Override
public List<HomeBeanWithImageData> getAllHomesWithImageData() {
return productDao.getAllHomesWithImageData();
}
@Transactional
@Override
public Boolean checkOrderNo(String checkNum) {
return productDao.checkOrderNo(checkNum);
}
@Transactional
@Override
public List<Movie_Genre> getAllMovieType() {
return productDao.getAllMovieType();
}
@Transactional
@Override
public List<MovieBean> getMovieByString(String movieType) {
return productDao.getMovieByString(movieType);
}
@Transactional
@Override
public ArrayList<Integer> getBookedList() {
return productDao.getBookedList();
}
@Transactional
@Override
public double getRate(int roomId) {
return productDao.getRate(roomId);
}
@Transactional
@Override
public List<Food_Genre> getAllFoodType() {
return productDao.getAllFoodType();
}
@Transactional
@Override
public List<FoodBean> getFoodByString(String foodType) {
return productDao.getFoodByString(foodType);
}
@Transactional
@Override
public List<String> getAllRoom() {
return productDao.getAllRoom();
}
@Transactional
@Override
public List<RoomBean> getRoomByString(String roomType) {
return productDao.getRoomByString(roomType);
}
@Transactional
@Override
public List<CartOrderBean> getOrderById(String memberId) {
List<CartOrderBean> list = null;
list = productDao.getOrderById(memberId);
return list;
}
@Transactional
@Override
public List<CartOrderFood> getFoodByBean(CartOrderBean bean) {
List<CartOrderFood> list = null;
list = productDao.getFoodByBean(bean);
return list;
}
@Transactional
@Override
public CartOrderBean getIdByNo(String orderNo) {
return productDao.getIdByNo(orderNo);
}
@Transactional
@Override
public void saveSurvey(SurveyBean satisfy) {
productDao.saveSurvey(satisfy);
}
@Transactional
@Override
public Double getSatisfy() {
return productDao.getSatisfy();
}
@Transactional
@Override
public List<MovieBean> getMovieByFuzzy(String movieStr) {
return productDao.getMovieByFuzzy(movieStr);
}
@Transactional
@Override
public List<Integer> getOrderedMidList() {
return productDao.getOrderedMidList();
}
@Transactional
@Override
public String getPercenstByMId(int movieId) {
return productDao.getPercenstByMId(movieId);
}
@Transactional
@Override
public String getMovieNameById(int movieId) {
return productDao.getMovieNameById(movieId);
}
@Transactional
@Override
public List<SurveyBean> getSurveyByNo(String orderno) {
return productDao.getSurveyByNo(orderno);
}
@Transactional
@Override
public Integer getAllMoney() {
return productDao.getAllMoney();
}
@Transactional
@Override
public Integer getAllMemberQua() {
return productDao.getAllMemberQua();
}
@Transactional
@Override
public Integer getAllRoomQua() {
return productDao.getAllRoomQua();
}
@Transactional
@Override
public Integer getAllRateMemberQua() {
return productDao.getAllRateMemberQua();
}
@Transactional
@Override
public Integer getAllStar() {
return productDao.getAllStar();
}
}
| UTF-8 | Java | 7,341 | java | ProductServiecImpl.java | Java | []
| null | []
| package com.web.store.service.impl;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.web.store.dao.ProductDao;
import com.web.store.model.CartOrderBean;
import com.web.store.model.CartOrderFood;
import com.web.store.model.FoodBean;
import com.web.store.model.FoodBeanWithImageData;
import com.web.store.model.Food_Genre;
import com.web.store.model.HomeBeanWithImageData;
import com.web.store.model.MovieBean;
import com.web.store.model.MovieBeanWithImageData;
import com.web.store.model.Movie_Genre;
import com.web.store.model.RoomBean;
import com.web.store.model.RoomBeanWithImageData;
import com.web.store.model.SurveyBean;
import com.web.store.service.ProductServiec;
@Service
public class ProductServiecImpl implements ProductServiec {
@Autowired
ProductDao productDao;
//Food
@Transactional
@Override
public List<FoodBean> getAllProducts() {
return productDao.getAllProducts();
}
@Transactional
@Override
public List<String> getAllCategories() {
return productDao.getAllCategories();
}
@Transactional
@Override
public List<FoodBean> getFoodByCategory(String category) {
return productDao.getFoodByCategory(category);
}
@Transactional
@Override
public FoodBean getProductById(int productId) {
return productDao.getProductById(productId);
}
//movie方法
@Transactional
@Override
public List<MovieBean> getAllProducts1() {
return productDao.getAllProducts1();
}
@Transactional
@Override
public List<String> getAllCategories1() {
return productDao.getAllCategories1();
}
@Transactional
@Override
public List<MovieBean> getProductsByCategory1(String category) {
return productDao.getProductsByCategory1(category);
}
@Transactional
@Override
public MovieBean getProductById1(int productId) {
return productDao.getProductById1(productId);
}
//Room
@Transactional
@Override
public List<RoomBean> getAllProducts2() {
return productDao.getAllProducts2();
}
@Transactional
@Override
public List<String> getAllCategories2() {
return productDao.getAllCategories2();
}
@Transactional
@Override
public List<RoomBean> getProductsByCategory2(String category) {
return productDao.getProductsByCategory2(category);
}
@Transactional
@Override
public RoomBean getProductById2(int productId) {
return productDao.getProductById2(productId);
}
@Transactional
@Override
public List<FoodBeanWithImageData> getAllFoodsWithImageData() {
return productDao.getAllFoodsWithImageData();
}
@Transactional
@Override
public List<MovieBeanWithImageData> getAllMoviesWithImageData() {
return productDao.getAllMoviesWithImageData();
}
@Transactional
@Override
public List<RoomBeanWithImageData> getAllRoomsWithImageData() {
return productDao.getAllRoomsWithImageData();
}
@Transactional
@Override
public List<FoodBean> getFoodType() {
return productDao.getFoodType();
}
@Transactional
@Override
public List<FoodBean> getSelectfoodTypes() {
return productDao.getSelectfoodTypes();
}
@Transactional
@Override
public List<FoodBean> getSelectfoods(Integer foodTypeId) {
return productDao.getSelectfoods(foodTypeId);
}
@Transactional
@Override
public List<MovieBean> getSelectmovies(Integer movieTypeId) {
return productDao.getSelectmovies(movieTypeId);
}
@Transactional
@Override
public List<MovieBean> getSelectmovieTypes() {
return productDao.getSelectmovieTypes();
}
@Transactional
@Override
public List<RoomBean> getSelectrooms(Integer roomNameId) {
return productDao.getSelectrooms(roomNameId);
}
@Transactional
@Override
public List<RoomBean> getSelectroomTypes() {
return productDao.getSelectroomTypes();
}
@Transactional
@Override
public void cartToDB(CartOrderBean cob) {
productDao.cartToDB(cob);
}
@Transactional
@Override
public boolean checkOrderTime(int orderRoomId, String checkDay, String checkStart, String checkEnd)
throws ParseException {
return productDao.checkOrderTime(orderRoomId,checkDay,checkStart,checkEnd);
}
@Transactional
@Override
public List<HomeBeanWithImageData> getAllHomesWithImageData() {
return productDao.getAllHomesWithImageData();
}
@Transactional
@Override
public Boolean checkOrderNo(String checkNum) {
return productDao.checkOrderNo(checkNum);
}
@Transactional
@Override
public List<Movie_Genre> getAllMovieType() {
return productDao.getAllMovieType();
}
@Transactional
@Override
public List<MovieBean> getMovieByString(String movieType) {
return productDao.getMovieByString(movieType);
}
@Transactional
@Override
public ArrayList<Integer> getBookedList() {
return productDao.getBookedList();
}
@Transactional
@Override
public double getRate(int roomId) {
return productDao.getRate(roomId);
}
@Transactional
@Override
public List<Food_Genre> getAllFoodType() {
return productDao.getAllFoodType();
}
@Transactional
@Override
public List<FoodBean> getFoodByString(String foodType) {
return productDao.getFoodByString(foodType);
}
@Transactional
@Override
public List<String> getAllRoom() {
return productDao.getAllRoom();
}
@Transactional
@Override
public List<RoomBean> getRoomByString(String roomType) {
return productDao.getRoomByString(roomType);
}
@Transactional
@Override
public List<CartOrderBean> getOrderById(String memberId) {
List<CartOrderBean> list = null;
list = productDao.getOrderById(memberId);
return list;
}
@Transactional
@Override
public List<CartOrderFood> getFoodByBean(CartOrderBean bean) {
List<CartOrderFood> list = null;
list = productDao.getFoodByBean(bean);
return list;
}
@Transactional
@Override
public CartOrderBean getIdByNo(String orderNo) {
return productDao.getIdByNo(orderNo);
}
@Transactional
@Override
public void saveSurvey(SurveyBean satisfy) {
productDao.saveSurvey(satisfy);
}
@Transactional
@Override
public Double getSatisfy() {
return productDao.getSatisfy();
}
@Transactional
@Override
public List<MovieBean> getMovieByFuzzy(String movieStr) {
return productDao.getMovieByFuzzy(movieStr);
}
@Transactional
@Override
public List<Integer> getOrderedMidList() {
return productDao.getOrderedMidList();
}
@Transactional
@Override
public String getPercenstByMId(int movieId) {
return productDao.getPercenstByMId(movieId);
}
@Transactional
@Override
public String getMovieNameById(int movieId) {
return productDao.getMovieNameById(movieId);
}
@Transactional
@Override
public List<SurveyBean> getSurveyByNo(String orderno) {
return productDao.getSurveyByNo(orderno);
}
@Transactional
@Override
public Integer getAllMoney() {
return productDao.getAllMoney();
}
@Transactional
@Override
public Integer getAllMemberQua() {
return productDao.getAllMemberQua();
}
@Transactional
@Override
public Integer getAllRoomQua() {
return productDao.getAllRoomQua();
}
@Transactional
@Override
public Integer getAllRateMemberQua() {
return productDao.getAllRateMemberQua();
}
@Transactional
@Override
public Integer getAllStar() {
return productDao.getAllStar();
}
}
| 7,341 | 0.777293 | 0.775112 | 327 | 21.437309 | 20.046312 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.327217 | false | false | 0 |
ec35870bd0c7905a87f13c78ebcfe399479dffff | 31,791,347,982,915 | bd8d60f226bca2f0ab53ae45ebfca6bd921ccbe6 | /src/main/java/com/stackroute/samplepassengerrealtion/dao/PassengerImpl.java | 3d1a795db96c326b99569223714f414d1228f230 | []
| no_license | itsthakuramit/hibernate-associations-demo | https://github.com/itsthakuramit/hibernate-associations-demo | 96b1cf3b7a1f9e12f601896f2d1f4e1267f56695 | 17701535d2792236e9b072fcb4bf7d4546f6080a | refs/heads/master | 2023-05-28T16:40:34.362000 | 2021-05-13T09:09:12 | 2021-05-13T09:09:12 | 377,590,775 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.stackroute.samplepassengerrealtion.dao;
import java.util.List;
import javax.transaction.Transactional;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.stackroute.samplepassengerrealtion.model.Passenger;
@Repository
@Transactional
public class PassengerImpl implements iPassenger{
@Autowired
SessionFactory sessfactory;
public Passenger add(Passenger passobj) {
sessfactory.getCurrentSession().save(passobj);
return passobj;
}
public List<Passenger> view() {
return sessfactory.getCurrentSession().createQuery("from Passenger").list();
}
}
| UTF-8 | Java | 699 | java | PassengerImpl.java | Java | []
| null | []
| package com.stackroute.samplepassengerrealtion.dao;
import java.util.List;
import javax.transaction.Transactional;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.stackroute.samplepassengerrealtion.model.Passenger;
@Repository
@Transactional
public class PassengerImpl implements iPassenger{
@Autowired
SessionFactory sessfactory;
public Passenger add(Passenger passobj) {
sessfactory.getCurrentSession().save(passobj);
return passobj;
}
public List<Passenger> view() {
return sessfactory.getCurrentSession().createQuery("from Passenger").list();
}
}
| 699 | 0.798283 | 0.798283 | 35 | 18.971428 | 22.958952 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.857143 | false | false | 0 |
7f0d93d089670f0e8a21185e6b8580d0163ed1a0 | 14,267,881,416,469 | 0c66826a48c962b6bf91f3480ddb9bc229c166b1 | /app/src/main/java/com/doschool/hs/act/event/RelationListUpdateEvent.java | cfb4de056d27d7cbf106aafd7733971de4470531 | []
| no_license | githubyxl/hs2018 | https://github.com/githubyxl/hs2018 | b9e0264c6002719997f2b8034110afa8d935f6a2 | fa75b448befbdc01d91066fe4611e30af8d05e80 | refs/heads/master | 2018-10-14T22:12:47.462000 | 2018-08-01T08:41:19 | 2018-08-01T08:41:19 | 138,141,673 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.doschool.hs.act.event;
public class RelationListUpdateEvent {
}
| UTF-8 | Java | 80 | java | RelationListUpdateEvent.java | Java | []
| null | []
| package com.doschool.hs.act.event;
public class RelationListUpdateEvent {
}
| 80 | 0.775 | 0.775 | 7 | 10.428572 | 16.211611 | 38 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | false | false | 0 |
fe9a4ab2421f5df5b6193750cdab0a4b5f9aebb7 | 22,497,038,728,021 | ac40d06433e8c4852f02d828cb8fe54e5c9b405b | /KarafCommands/src/main/java/org/singam/karaf/bundle/dependency/installer/GetBlueprintComponents.java | 2a7b3a0bdde47a27e826692868fd86a7dd8cfbf6 | []
| no_license | arunsrajan/KarafServer | https://github.com/arunsrajan/KarafServer | fac2531dce7fadc3a19138924946a2d1321a1414 | cfa71df4cbfa62e7609b12c903e9233d83d5c07c | refs/heads/master | 2022-05-23T05:56:45.004000 | 2018-10-08T00:53:53 | 2018-10-08T00:53:53 | 151,997,770 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.singam.karaf.bundle.dependency.installer;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.apache.karaf.system.SystemService;
import org.osgi.framework.ServiceReference;
import org.osgi.service.blueprint.container.BlueprintContainer;
@Command(scope = "blueprint", name = "components", description="Karaf Blueprint Components")
public class GetBlueprintComponents extends OsgiCommandSupport {
@Override
protected Object doExecute() throws Exception {
ServiceReference<BlueprintContainer> blueprintServiceRef=bundleContext.getServiceReference(BlueprintContainer.class);
BlueprintContainer blueprintContainer = bundleContext.getService(blueprintServiceRef);
blueprintContainer.getComponentIds().stream().forEach(component->{
System.out.println(component);
System.out.println(blueprintContainer.getComponentInstance(component));
});
return null;
}
}
| UTF-8 | Java | 977 | java | GetBlueprintComponents.java | Java | []
| null | []
| package org.singam.karaf.bundle.dependency.installer;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.apache.karaf.system.SystemService;
import org.osgi.framework.ServiceReference;
import org.osgi.service.blueprint.container.BlueprintContainer;
@Command(scope = "blueprint", name = "components", description="Karaf Blueprint Components")
public class GetBlueprintComponents extends OsgiCommandSupport {
@Override
protected Object doExecute() throws Exception {
ServiceReference<BlueprintContainer> blueprintServiceRef=bundleContext.getServiceReference(BlueprintContainer.class);
BlueprintContainer blueprintContainer = bundleContext.getService(blueprintServiceRef);
blueprintContainer.getComponentIds().stream().forEach(component->{
System.out.println(component);
System.out.println(blueprintContainer.getComponentInstance(component));
});
return null;
}
}
| 977 | 0.801433 | 0.801433 | 24 | 38.708332 | 34.423199 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.5 | false | false | 0 |
8550b824f42db3080f1817595c7569cba0cc21e2 | 23,184,233,499,898 | d15140eb873281594e1ec23ab2c01d6d697d75d3 | /week_SP_5_JavaExcelTable/src/Controller.java | d2e9f56a9f6886227e9ad75730d003f07ad41401 | [
"MIT"
]
| permissive | drozdms/BSU_Java_Projects | https://github.com/drozdms/BSU_Java_Projects | ad744c06b424a86fd6ce15ab7b43a2b0cdf49411 | ac5ae0cab45dc34f568bd240c80c8bb666440243 | refs/heads/master | 2023-04-04T08:18:38.142000 | 2021-04-11T12:14:38 | 2021-04-11T12:14:38 | 356,856,808 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
/**
*
* @author Mark Drozd
*/
public class Controller implements TableModelListener
{
private Model model;
private View view;
public Controller(Model model, View view)
{
this.model=model;
this.view=view;
}
@Override
public void tableChanged(TableModelEvent e) {
//
}
}
| UTF-8 | Java | 428 | java | Controller.java | Java | [
{
"context": "swing.event.TableModelListener;\n\n/**\n *\n * @author Mark Drozd\n */\npublic class Controller implements TableModel",
"end": 117,
"score": 0.9998173713684082,
"start": 107,
"tag": "NAME",
"value": "Mark Drozd"
}
]
| null | []
|
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
/**
*
* @author <NAME>
*/
public class Controller implements TableModelListener
{
private Model model;
private View view;
public Controller(Model model, View view)
{
this.model=model;
this.view=view;
}
@Override
public void tableChanged(TableModelEvent e) {
//
}
}
| 424 | 0.647196 | 0.647196 | 24 | 16.791666 | 17.248138 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.291667 | false | false | 0 |
55dadfd3170ac2f75c1a6ca46f1b94a66767a632 | 11,656,541,247,170 | bb2543ea500877c8b459f9e1bbc9238bea6aa631 | /src/main/java/com/peploleum/insight/yummy/dto/source/elasticearch/EsQuery.java | 3ba895a1c3c0fff6d9fda1ff1f8f5eab8a99f20d | []
| no_license | peploleum/yummy | https://github.com/peploleum/yummy | fa49fce68cadbfb648aa81312014153124a06996 | 2d0ffe853da5592c1af4712cb34800c329100eae | refs/heads/master | 2022-09-04T12:43:14.539000 | 2019-05-28T16:10:04 | 2019-05-28T16:10:04 | 161,391,875 | 3 | 0 | null | false | 2022-08-06T05:22:43 | 2018-12-11T20:48:11 | 2019-05-28T16:10:20 | 2022-08-06T05:22:40 | 1,025 | 2 | 0 | 3 | Java | false | false | package com.peploleum.insight.yummy.dto.source.elasticearch;
/**
* Created by cpoullot on 18/01/2019.
* contenu (Body) Json de la requete a envoyer a elasticearch
*/
public class EsQuery {
private String content;
public EsQuery() {
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
| UTF-8 | Java | 403 | java | EsQuery.java | Java | [
{
"context": ".yummy.dto.source.elasticearch;\n\n/**\n * Created by cpoullot on 18/01/2019.\n * contenu (Body) Json de la reque",
"end": 88,
"score": 0.999600887298584,
"start": 80,
"tag": "USERNAME",
"value": "cpoullot"
}
]
| null | []
| package com.peploleum.insight.yummy.dto.source.elasticearch;
/**
* Created by cpoullot on 18/01/2019.
* contenu (Body) Json de la requete a envoyer a elasticearch
*/
public class EsQuery {
private String content;
public EsQuery() {
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
| 403 | 0.652605 | 0.632754 | 22 | 17.318182 | 19.461819 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | false | false | 0 |
19b889bbc19c13b9f6ff46be7472cd134b31b19e | 26,645,977,144,526 | 7ed670dc0f02ceb3dd9c23c24e1d3aafce38882a | /src/main/java/com/sensor/db/bean/FunnelBean.java | b457ad1e9f943639ec9ba172cca0d86945f29404 | []
| no_license | unasm/javaCheck | https://github.com/unasm/javaCheck | f2c716733d854e5c950300f2127332c4f01d2779 | 95f42406c0b92fcedce3f44380473046e1ca35b9 | refs/heads/master | 2021-01-23T19:34:14.455000 | 2017-09-08T06:57:36 | 2017-09-08T06:57:36 | 102,830,350 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.sensor.db.bean;
/**
* Created by tianyi on 05/09/2017.
*/
public class FunnelBean {
private int id;
private int userId;
private String name;
private int maxConvertTime;
private String steps;
private String comment;
private int projectId;
public FunnelBean() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public int getUserId() {
return this.userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public int getMaxConvertTime() {
return this.maxConvertTime;
}
public void setMaxConvertTime(int maxConvertTime) {
this.maxConvertTime = maxConvertTime;
}
public String getSteps() {
return this.steps;
}
public void setSteps(String steps) {
this.steps = steps;
}
public String getComment() {
return this.comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public String toString() {
return "FunnelBean{id=" + this.id + ", userId=" + this.userId + ", name=\'" + this.name + '\'' + ", maxConvertTime=" + this.maxConvertTime + ", steps=\'" + this.steps + '\'' + ", comment=\'" + this.comment + '\'' + '}';
}
public int getProjectId() {
return this.projectId;
}
public void setProjectId(int projectId) {
this.projectId = projectId;
}
}
| UTF-8 | Java | 1,617 | java | FunnelBean.java | Java | [
{
"context": "package com.sensor.db.bean;\n\n/**\n * Created by tianyi on 05/09/2017.\n */\npublic class FunnelBean {\n ",
"end": 53,
"score": 0.9995984435081482,
"start": 47,
"tag": "USERNAME",
"value": "tianyi"
}
]
| null | []
| package com.sensor.db.bean;
/**
* Created by tianyi on 05/09/2017.
*/
public class FunnelBean {
private int id;
private int userId;
private String name;
private int maxConvertTime;
private String steps;
private String comment;
private int projectId;
public FunnelBean() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public int getUserId() {
return this.userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public int getMaxConvertTime() {
return this.maxConvertTime;
}
public void setMaxConvertTime(int maxConvertTime) {
this.maxConvertTime = maxConvertTime;
}
public String getSteps() {
return this.steps;
}
public void setSteps(String steps) {
this.steps = steps;
}
public String getComment() {
return this.comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public String toString() {
return "FunnelBean{id=" + this.id + ", userId=" + this.userId + ", name=\'" + this.name + '\'' + ", maxConvertTime=" + this.maxConvertTime + ", steps=\'" + this.steps + '\'' + ", comment=\'" + this.comment + '\'' + '}';
}
public int getProjectId() {
return this.projectId;
}
public void setProjectId(int projectId) {
this.projectId = projectId;
}
}
| 1,617 | 0.581323 | 0.576376 | 77 | 20 | 28.127262 | 227 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false | 0 |
2e62ecbce07b66824f6d502e98c98584c154d9fe | 13,314,398,650,890 | add3befb9e8ac259ed7adcf3e8d9a412f458fec6 | /monkey-api-sign-core/src/main/java/com/r/study/monkey/sign/algorithm/Md5SignAlgorithm.java | 9498db9e9c4443ed6cf109ad0456fd16323e8235 | []
| no_license | bellmit/Rstudy | https://github.com/bellmit/Rstudy | 4e1e5c1ac76a4f1ae08cfce1e1ad7d2cc3611fac | 4d5886715beb35ed46732af412fb4f208b35af2b | refs/heads/master | 2023-07-13T06:49:17.931000 | 2021-08-03T07:01:25 | 2021-08-03T07:01:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.r.study.monkey.sign.algorithm;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/**
* MD5签名算法实现
*
*/
public class Md5SignAlgorithm implements SignAlgorithm {
@Override
public String sign(Map<String, Object> param, String signKey) throws Exception {
Map<String, Object> signDataMap = new LinkedHashMap<>(param.size());
signDataMap.putAll(param);
//去除sign和data参数
signDataMap.remove("sign");
signDataMap.remove("data");
Set<String> keySet = signDataMap.keySet();
String contentStr = "";
for (String key : keySet) {
if (StringUtils.isEmpty(contentStr)) {
contentStr = key + "=" + signDataMap.get(key);
} else {
contentStr = contentStr + "&" + key + "=" + signDataMap.get(key);
}
}
if (!StringUtils.isEmpty(contentStr)) {
contentStr = contentStr + "&" + signKey;
}
String md5 = DigestUtils.md5DigestAsHex(contentStr.getBytes());
return md5.toLowerCase();
}
@Override
public boolean checkSign(Map<String, Object> param, String checkSignKey) throws Exception {
String reqSign = (String) param.get("sign");
String sign = sign(param, checkSignKey);
return reqSign != null && reqSign.equals(sign);
}
}
| UTF-8 | Java | 1,453 | java | Md5SignAlgorithm.java | Java | []
| null | []
| package com.r.study.monkey.sign.algorithm;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/**
* MD5签名算法实现
*
*/
public class Md5SignAlgorithm implements SignAlgorithm {
@Override
public String sign(Map<String, Object> param, String signKey) throws Exception {
Map<String, Object> signDataMap = new LinkedHashMap<>(param.size());
signDataMap.putAll(param);
//去除sign和data参数
signDataMap.remove("sign");
signDataMap.remove("data");
Set<String> keySet = signDataMap.keySet();
String contentStr = "";
for (String key : keySet) {
if (StringUtils.isEmpty(contentStr)) {
contentStr = key + "=" + signDataMap.get(key);
} else {
contentStr = contentStr + "&" + key + "=" + signDataMap.get(key);
}
}
if (!StringUtils.isEmpty(contentStr)) {
contentStr = contentStr + "&" + signKey;
}
String md5 = DigestUtils.md5DigestAsHex(contentStr.getBytes());
return md5.toLowerCase();
}
@Override
public boolean checkSign(Map<String, Object> param, String checkSignKey) throws Exception {
String reqSign = (String) param.get("sign");
String sign = sign(param, checkSignKey);
return reqSign != null && reqSign.equals(sign);
}
}
| 1,453 | 0.636618 | 0.633124 | 45 | 30.799999 | 25.460732 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false | 0 |
7940139acb851db6b8417409c49cf06090e9bee9 | 28,235,115,015,988 | 247d4a9510aabfe6611b561a84dbe94390424da5 | /src/main/java/ui/options/panes/ProjectOptionsPane.java | f0426cbd768debcba581725d3dc90061eb712c8e | []
| no_license | akochamdev/ToolBank | https://github.com/akochamdev/ToolBank | b92bf592e2d9a5f22c7f6c428ee1067eac198b77 | 2661acbb0f3fe3f7542352becc11f83f921a7188 | refs/heads/master | 2018-03-28T08:14:20.120000 | 2017-05-11T18:20:51 | 2017-05-11T18:20:51 | 87,485,827 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ui.options.panes;
import org.jdesktop.swingx.JXTaskPane;
import ui.cards.CardConstants;
import ui.cards.CardsPanel;
import javax.swing.*;
/**
* Task pane that represents the project options available to the user. Contains a series of buttons that will
* switch to the appropriate card in the CardLayout view.
*/
public class ProjectOptionsPane extends JXTaskPane {
public ProjectOptionsPane(String title) {
super(title);
JButton viewProjectsButton = new JButton("View Projects");
viewProjectsButton.addActionListener(e -> CardsPanel.getInstance().showCard(CardConstants.VIEW_PROJECTS));
add(viewProjectsButton);
JButton addProjectButton = new JButton("Add Project");
addProjectButton.addActionListener(e -> CardsPanel.getInstance().showCard(CardConstants.ADD_PROJECT));
add(addProjectButton);
}
} | UTF-8 | Java | 879 | java | ProjectOptionsPane.java | Java | []
| null | []
| package ui.options.panes;
import org.jdesktop.swingx.JXTaskPane;
import ui.cards.CardConstants;
import ui.cards.CardsPanel;
import javax.swing.*;
/**
* Task pane that represents the project options available to the user. Contains a series of buttons that will
* switch to the appropriate card in the CardLayout view.
*/
public class ProjectOptionsPane extends JXTaskPane {
public ProjectOptionsPane(String title) {
super(title);
JButton viewProjectsButton = new JButton("View Projects");
viewProjectsButton.addActionListener(e -> CardsPanel.getInstance().showCard(CardConstants.VIEW_PROJECTS));
add(viewProjectsButton);
JButton addProjectButton = new JButton("Add Project");
addProjectButton.addActionListener(e -> CardsPanel.getInstance().showCard(CardConstants.ADD_PROJECT));
add(addProjectButton);
}
} | 879 | 0.739477 | 0.739477 | 27 | 31.592592 | 35.063179 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 0 |
c78296ac5d1cc1901dd739d1e3ddf6c7b3488d9a | 22,986,664,995,637 | 009d18eb4b877ab2e653e69e766e2d86b1928757 | /CodigoDeFuente/src/jp/pioneer/ce/aam2/AAM2Kit/a/b.java | 0d160fe23886c1e0f44541ecdb3fb44d021408d5 | []
| no_license | secretline/waze-security-paper | https://github.com/secretline/waze-security-paper | 3a6fbaf6dfa63aca81c195d9c9ffb8ba9c827b71 | eb573a23e4f2cbe4484fd2a1b1f09c31d5364fe4 | refs/heads/master | 2016-09-07T18:14:39.292000 | 2015-06-28T19:15:45 | 2015-06-28T19:15:45 | 38,207,099 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package jp.pioneer.ce.aam2.AAM2Kit.a;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
import com.abaltatech.protocoldispatcher.IPProtocolDispatcherPrivate;
import com.abaltatech.weblinkserver.WLServerApp;
import jp.pioneer.ce.aam2.AAM2Kit.b.a;
// Referenced classes of package jp.pioneer.ce.aam2.AAM2Kit.a:
// a
class b
implements ServiceConnection
{
final jp.pioneer.ce.aam2.AAM2Kit.a.a a;
b(jp.pioneer.ce.aam2.AAM2Kit.a.a a1)
{
a = a1;
super();
}
public void onServiceConnected(ComponentName componentname, IBinder ibinder)
{
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, com.abaltatech.protocoldispatcher.IPProtocolDispatcherPrivate.Stub.asInterface(ibinder));
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, true);
if (a.a)
{
if (jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a) != null)
{
try
{
int i = Process.myPid();
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a).setActiveApp(i);
}
catch (RemoteException remoteexception)
{
jp.pioneer.ce.aam2.AAM2Kit.b.a.a("An error occured during the call", remoteexception);
}
}
a.a = false;
}
}
public void onServiceDisconnected(ComponentName componentname)
{
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, null);
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, false);
ComponentName componentname1 = new ComponentName("jp.pioneer.mbg.appradio.AppRadioLauncher", "com.abaltatech.protocoldispatcher.ProtocolDispatcherService");
Intent intent = new Intent("abaltatech.intent.action.bindProtocolDispatcherPrivateService");
intent.setComponent(componentname1);
WLServerApp.getApplication().bindService(intent, jp.pioneer.ce.aam2.AAM2Kit.a.a.b(a), 1);
}
}
| UTF-8 | Java | 2,225 | java | b.java | Java | [
{
"context": "// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.\n// Jad home page: http://www.geocities.com/kpdus",
"end": 61,
"score": 0.9996861219406128,
"start": 45,
"tag": "NAME",
"value": "Pavel Kouznetsov"
}
]
| null | []
| // Decompiled by Jad v1.5.8e. Copyright 2001 <NAME>.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package jp.pioneer.ce.aam2.AAM2Kit.a;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
import com.abaltatech.protocoldispatcher.IPProtocolDispatcherPrivate;
import com.abaltatech.weblinkserver.WLServerApp;
import jp.pioneer.ce.aam2.AAM2Kit.b.a;
// Referenced classes of package jp.pioneer.ce.aam2.AAM2Kit.a:
// a
class b
implements ServiceConnection
{
final jp.pioneer.ce.aam2.AAM2Kit.a.a a;
b(jp.pioneer.ce.aam2.AAM2Kit.a.a a1)
{
a = a1;
super();
}
public void onServiceConnected(ComponentName componentname, IBinder ibinder)
{
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, com.abaltatech.protocoldispatcher.IPProtocolDispatcherPrivate.Stub.asInterface(ibinder));
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, true);
if (a.a)
{
if (jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a) != null)
{
try
{
int i = Process.myPid();
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a).setActiveApp(i);
}
catch (RemoteException remoteexception)
{
jp.pioneer.ce.aam2.AAM2Kit.b.a.a("An error occured during the call", remoteexception);
}
}
a.a = false;
}
}
public void onServiceDisconnected(ComponentName componentname)
{
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, null);
jp.pioneer.ce.aam2.AAM2Kit.a.a.a(a, false);
ComponentName componentname1 = new ComponentName("jp.pioneer.mbg.appradio.AppRadioLauncher", "com.abaltatech.protocoldispatcher.ProtocolDispatcherService");
Intent intent = new Intent("abaltatech.intent.action.bindProtocolDispatcherPrivateService");
intent.setComponent(componentname1);
WLServerApp.getApplication().bindService(intent, jp.pioneer.ce.aam2.AAM2Kit.a.a.b(a), 1);
}
}
| 2,215 | 0.654831 | 0.637753 | 63 | 34.317459 | 34.105263 | 164 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.539683 | false | false | 0 |
17702d6cd4c4da92f3ce1b2e300d8c0c04f3d3c4 | 14,766,097,630,940 | d9745a906c5e5f50191eeec14880d13ff00b2160 | /src/main/java/com/hansonwang99/web/IndexController.java | 9af0957b5b31ae979302633cb6c3d4f5770b6c7c | []
| no_license | zhengxiaochuan/hsite | https://github.com/zhengxiaochuan/hsite | dfe447fa108689cf6bfb2d89c4d1b13b8478803c | 7f9974027c395aa6d50d6bb2acf32dee0b77bb75 | refs/heads/master | 2020-04-02T16:56:40.887000 | 2018-08-24T14:16:31 | 2018-08-24T14:16:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hansonwang99.web;
import com.hansonwang99.comm.Const;
import com.hansonwang99.domain.Category;
import com.hansonwang99.repository.CategoryRepository;
import com.hansonwang99.service.CategoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
/**
* Created by hansonwang on 2017/6/2.
*/
@Controller
public class IndexController extends BaseController {
@Autowired
private CategoryRepository categoryRepository;
@Resource
private CategoryService categoryService;
@ApiOperation(value="显示网站首页视图", notes="显示网站首页视图")
@RequestMapping(value="/",method= RequestMethod.GET)
public String index(Model model) {
return "index";
}
@ApiOperation(value="显示用户登录视图", notes="显示用户登录视图")
@RequestMapping(value="/login",method= RequestMethod.GET)
public String login(Model model) {
return "login";
}
@ApiOperation(value="显示主框架视图", notes="显示主框架视图")
@RequestMapping(value="/home",method= RequestMethod.GET)
public String home(Model model) {
String defaultCategoryName = "默认分类";
Category category = categoryRepository.findByUserIdAndName( getUserId(), defaultCategoryName );
if(null != category){
logger.info("默认分类已经存在了,无需再创建");
}else{
try {
categoryService.saveCategory(getUserId(), 0l, defaultCategoryName);
} catch (Exception e) {
logger.error("创建默认分类出现异常:",e);
}
}
model.addAttribute("user",getUser());
return "home";
}
@ApiOperation(value="显示弹出式编辑器md书写区视图", notes="显示弹出式编辑器md书写区视图")
@RequestMapping(value="/write",method= RequestMethod.GET)
public String write(Model model) {
return "write";
}
@ApiOperation(value="显示用户注册视图", notes="显示用户注册视图")
@RequestMapping(value="/register",method= RequestMethod.GET)
public String register(Model model) {
return "register";
}
@ApiOperation(value="显示用户登出返回网站首页视图", notes="显示用户登出返回网站首页视图")
@RequestMapping(value="/logout",method=RequestMethod.GET)
public String logout(HttpServletResponse response, Model model) {
getSession().removeAttribute(Const.LOGIN_SESSION_KEY);
getSession().removeAttribute(Const.LAST_REFERER);
Cookie cookie = new Cookie(Const.LOGIN_SESSION_KEY, "");
cookie.setMaxAge(0);
cookie.setPath("/");
response.addCookie(cookie);
return "index";
}
@ApiOperation(value="显示上传用户图像视图", notes="显示上传用户图像视图")
@RequestMapping(value="/uploadHeadPortrait",method = RequestMethod.POST)
public String uploadHeadPortrait(){
return "user/uploadheadportrait";
}
@ApiOperation(value="显示新建文章分类视图", notes="显示新建文章分类视图")
@RequestMapping(value="/newCategory",method = RequestMethod.POST)
public String newCategory(){
return "category/newcategory";
}
@ApiOperation(value="显示身高百分位表视图", notes="显示身高百分位表视图")
@RequestMapping(value="/heightsheet",method = RequestMethod.POST)
public String getHeightSheet(Model model){
return "tool/heightsheet";
}
}
| UTF-8 | Java | 3,897 | java | IndexController.java | Java | [
{
"context": "rvlet.http.HttpServletResponse;\n\n/**\n * Created by hansonwang on 2017/6/2.\n */\n@Controller\npublic class IndexCo",
"end": 676,
"score": 0.9997124671936035,
"start": 666,
"tag": "USERNAME",
"value": "hansonwang"
}
]
| null | []
| package com.hansonwang99.web;
import com.hansonwang99.comm.Const;
import com.hansonwang99.domain.Category;
import com.hansonwang99.repository.CategoryRepository;
import com.hansonwang99.service.CategoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
/**
* Created by hansonwang on 2017/6/2.
*/
@Controller
public class IndexController extends BaseController {
@Autowired
private CategoryRepository categoryRepository;
@Resource
private CategoryService categoryService;
@ApiOperation(value="显示网站首页视图", notes="显示网站首页视图")
@RequestMapping(value="/",method= RequestMethod.GET)
public String index(Model model) {
return "index";
}
@ApiOperation(value="显示用户登录视图", notes="显示用户登录视图")
@RequestMapping(value="/login",method= RequestMethod.GET)
public String login(Model model) {
return "login";
}
@ApiOperation(value="显示主框架视图", notes="显示主框架视图")
@RequestMapping(value="/home",method= RequestMethod.GET)
public String home(Model model) {
String defaultCategoryName = "默认分类";
Category category = categoryRepository.findByUserIdAndName( getUserId(), defaultCategoryName );
if(null != category){
logger.info("默认分类已经存在了,无需再创建");
}else{
try {
categoryService.saveCategory(getUserId(), 0l, defaultCategoryName);
} catch (Exception e) {
logger.error("创建默认分类出现异常:",e);
}
}
model.addAttribute("user",getUser());
return "home";
}
@ApiOperation(value="显示弹出式编辑器md书写区视图", notes="显示弹出式编辑器md书写区视图")
@RequestMapping(value="/write",method= RequestMethod.GET)
public String write(Model model) {
return "write";
}
@ApiOperation(value="显示用户注册视图", notes="显示用户注册视图")
@RequestMapping(value="/register",method= RequestMethod.GET)
public String register(Model model) {
return "register";
}
@ApiOperation(value="显示用户登出返回网站首页视图", notes="显示用户登出返回网站首页视图")
@RequestMapping(value="/logout",method=RequestMethod.GET)
public String logout(HttpServletResponse response, Model model) {
getSession().removeAttribute(Const.LOGIN_SESSION_KEY);
getSession().removeAttribute(Const.LAST_REFERER);
Cookie cookie = new Cookie(Const.LOGIN_SESSION_KEY, "");
cookie.setMaxAge(0);
cookie.setPath("/");
response.addCookie(cookie);
return "index";
}
@ApiOperation(value="显示上传用户图像视图", notes="显示上传用户图像视图")
@RequestMapping(value="/uploadHeadPortrait",method = RequestMethod.POST)
public String uploadHeadPortrait(){
return "user/uploadheadportrait";
}
@ApiOperation(value="显示新建文章分类视图", notes="显示新建文章分类视图")
@RequestMapping(value="/newCategory",method = RequestMethod.POST)
public String newCategory(){
return "category/newcategory";
}
@ApiOperation(value="显示身高百分位表视图", notes="显示身高百分位表视图")
@RequestMapping(value="/heightsheet",method = RequestMethod.POST)
public String getHeightSheet(Model model){
return "tool/heightsheet";
}
}
| 3,897 | 0.698709 | 0.693544 | 104 | 32.509617 | 24.595573 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.596154 | false | false | 0 |
df0e145d1f15bc7f1e6467f745a88458424e762e | 24,077,586,677,819 | 2fa5e30aaa31deedab06f7cfe59c6af104e656b0 | /src/main/java/MoneyTestHelper/OTPHelper.java | fc2afca02163f29b716eeefbc9ab11bbac3feb93 | []
| no_license | msr5464/Project1 | https://github.com/msr5464/Project1 | 9d5fb11b3ed73bcec0e6564613d53680ddff4459 | 1516bb03076e50132749f4aaf694ed0e949ec83f | refs/heads/master | 2018-10-05T14:23:13.795000 | 2017-06-12T06:44:25 | 2017-06-12T06:44:25 | 93,886,057 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package MoneyTestHelper;
import java.util.Map;
import MoneyPageObject.MobileApp.LoginScreen.ExpectedWelcomeScreen;
import Utils.Browser;
import Utils.Config;
import Utils.Helper;
import Utils.User;
import Utils.DatabaseHelper.AuthDBHelper;
import Utils.enums.database.AuthDB;
public class OTPHelper extends DashboardHelper{
private Config testConfig;
public enum ExpectedPage
{
WalletDashboardPage,ContactInformationPage,ReferralSignUpPage,PaymentLoginPage,OtpScreenOnApp,SignUpPage,CustomerSignUpPage
}
public OTPHelper(Config testConfig)
{
super(testConfig);
this.testConfig = testConfig;
}
/**
* This will click the Verify Button on Contact Information Page, Click on
* Resend OTP and check all the messages and DB
*
* @param Customer
* - Details of Customer
* @param totalOtpSent
* - Count of Total OTP Sent
* @param invalidCount
* - Count of Invalid OTP Entered
* @param OTPRequestType:
* - WalletRegisteration/ Adding Beneficiary/ Transfering Money To Bank
* @param ExpectedLandingPage:
* - Expected landing page
*/
public void verifyErrorMessageAndOTPTableOnRetryingOtp(User customer, int totalOtpSent, int invalidCount, OTPRequestType otpRequestType,
ExpectedPage expectedLandingPage) {
AuthDBHelper authDBHelper = new AuthDBHelper(testConfig);
Map<String, String> usersMapData = null;
int count = 2;
switch (expectedLandingPage) {
case ContactInformationPage:
contactInformationPage.clickVerifyBtnAndVerifySmsSentMessage(customer, totalOtpSent, invalidCount);
break;
case ReferralSignUpPage:
referralSignUpPage.fillCustomerRegistrationDetails(customer);
break;
case CustomerSignUpPage:
customersignUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case SignUpPage:
signUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
break;
default:
break;
}
while (count <= 6) {
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
break;
case ContactInformationPage:
contactInformationPage.clickResendOtp();
break;
case ReferralSignUpPage:
referralSignUpPage.clickResendOtp();
break;
case CustomerSignUpPage:
customersignUpPage.clickResendOtp();
break;
case SignUpPage:
signUpPage.clickResendOtp();
break;
case PaymentLoginPage:
if(testConfig.isMobile){
mobilePaymentLoginPage.clickResendOTPLink();;
}else{
paymentLoginPage.clickResendOTPLink();
}
break;
case OtpScreenOnApp:
otpScreen.clickOnResendOtpButton();
break;
default:
break;
}
if (count <= 5) {
Browser.wait(testConfig, 5);
String expectedSuccessMessage = null;
switch (expectedLandingPage) {
case WalletDashboardPage:
expectedSuccessMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(97, "Message String");
walletDashboardPage.verifyVerificationCodeSentMessageForOTP(expectedSuccessMessage);
break;
case ContactInformationPage:
expectedSuccessMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(64, "Message String");
String mobile = getMaskedNumberForOTP(customer.mobile);
testConfig.putRunTimeProperty("mobNum", mobile);
expectedSuccessMessage = Helper.replaceArgumentsWithRunTimeProperties(testConfig, expectedSuccessMessage);
contactInformationPage.verifySuccessMessageForOTP(expectedSuccessMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
/*case ReferralSignUpPage:
Browser.wait(testConfig, 3);
break;*/
case PaymentLoginPage:
expectedSuccessMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(64, "Message String");
testConfig.putRunTimeProperty("emailId", customer.userName);
if(testConfig.isMobile){
mobilePaymentLoginPage.verifySuccessMessageForOTP(customer,expectedSuccessMessage);
}else{
paymentLoginPage.verifySuccessMessageForOTP(customer,expectedSuccessMessage);
}
break;
default:
break;
}
authDBHelper.verifyOTPTable(customer, otpRequestType, count, invalidCount, false, false);
} else if (count > 5) {
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(72, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case CustomerSignUpPage:
customersignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case SignUpPage:
signUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyRetryErrorMessageForOTP();
}else{
paymentLoginPage.verifyRetryErrorMessageForOTP();
}
default:
break;
}
Browser.wait(testConfig, 2);
authDBHelper.verifyOTPTable(customer, otpRequestType, 5, invalidCount, false, false);
}
count++;
}
}
/**
* This will click the Verify Button on Contact Information Page, enter
* Expired OTP and check the messages
*
* @param Customer
* - Details of Customer
* @param totalOtpSent
* - Count of Total OTP Sent
* @param invalidCount
* - Count of Invalid OTP Entered
* @param OTPRequestType:
* - WalletRegisteration/ Adding Beneficiary/ Transfering Money To Bank
* @param ExpectedLandingPage:
* - Expected landing page
*/
public void verifyErrorMessageAndOTPTableOnEnteringExpiredOTP(User customer, int totalOtpSent, int invalidCount, OTPRequestType otpRequestType,
ExpectedPage expectedLandingPage) {
AuthDBHelper authDBHelper = new AuthDBHelper(testConfig);
Map<String, String> usersMapData = null;
switch (expectedLandingPage) {
case ContactInformationPage:
contactInformationPage.clickVerifyBtnAndVerifySmsSentMessage(customer, totalOtpSent, invalidCount);
break;
case ReferralSignUpPage:
referralSignUpPage.fillCustomerRegistrationDetails(customer);
break;
case CustomerSignUpPage:
customersignUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case SignUpPage:
signUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
Browser.wait(testConfig, 5);
break;
default:
break;
}
String Otpcode = authDBHelper.getDataFromOTPTable(customer.mobile, otpRequestType)
.get("otp");
switch (expectedLandingPage) {
case WalletDashboardPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
walletDashboardPage.clickActivateMyPayuMoneyWallet(Otpcode);
break;
case ContactInformationPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
contactInformationPage.clickVerifyBtn(Otpcode);
break;
case ReferralSignUpPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
referralSignUpPage.enterOTPAndClickSignUp(Otpcode,MoneyPageObject.Home.ReferralSignUpPage.ExpectedLandingPage.ReferralSignUpPage);
break;
case CustomerSignUpPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
customersignUpPage.enterOTPAndClickSignUp(customer, Otpcode,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case SignUpPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
signUpPage.enterOTPAndClickSignUp(customer, Otpcode,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case PaymentLoginPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
if(testConfig.isMobile)
{
mobilePaymentLoginPage.enterExpiredOtpAndClickQuickSignIn(Otpcode);
}else{
paymentLoginPage.enterExpiredOtpAndClickQuickSignIn(Otpcode);
}
break;
case OtpScreenOnApp:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
otpScreen.enterOtp(Otpcode).clickActivate(ExpectedWelcomeScreen.OtpScreen);
default:
break;
}
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(71, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case SignUpPage:
signUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case CustomerSignUpPage:
customersignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyExpiredOtpErrorMessage(expectedErrorMessage);
}else{
paymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}
default:
break;
}
}
/**
* This will click the Verify Button on Contact Information Page, enter OTP
* and verify DB and different Messages
*
* @param Customer
* - Details of Customer
* @param totalOtpSent
* - Count of Total OTP Sent
* @param invalidCount
* - Count of Invalid OTP Entered
* @param OTPRequestType:
* - WalletRegisteration/ Adding Beneficiary/ Transfering Money To Bank
* @param ExpectedLandingPage:
* - Expected landing page
*/
public void verifyErrorMessageAndOTPTableOnEnteringInvalidOTP(User customer, int totalOtpSent, int invalidCount, OTPRequestType otpRequestType,
ExpectedPage expectedLandingPage) {
int count = 1;
AuthDBHelper authDBHelper = new AuthDBHelper(testConfig);
Map<String, String> usersMapData = null;
switch (expectedLandingPage) {
case ContactInformationPage:
contactInformationPage.clickVerifyBtnAndVerifySmsSentMessage(customer, totalOtpSent, invalidCount);
break;
case ReferralSignUpPage:
referralSignUpPage.fillCustomerRegistrationDetails(customer);
break;
case CustomerSignUpPage:
customersignUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case SignUpPage:
signUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
break;
default:
break;
}
while (count <= 5) {
String invalidOtp = Helper.generateRandomNumber(6) + "";
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.clickActivateMyPayuMoneyWallet(invalidOtp);
break;
case ContactInformationPage:
contactInformationPage.clickVerifyBtn(invalidOtp);
break;
case ReferralSignUpPage:
referralSignUpPage.enterOTPAndClickSignUp(invalidOtp,MoneyPageObject.Home.ReferralSignUpPage.ExpectedLandingPage.ReferralSignUpPage);
break;
case CustomerSignUpPage:
customersignUpPage.enterOTPAndClickSignUp(customer, invalidOtp,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case SignUpPage:
signUpPage.enterOTPAndClickSignUp(customer, invalidOtp,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.enterInvalidOtp();
}else{
paymentLoginPage.enterInvalidOtpAndClickSignInBtn();
}
break;
case OtpScreenOnApp:
otpScreen.enterOtp(invalidOtp).clickActivate(ExpectedWelcomeScreen.OtpScreen);
break;
default:
break;
}
if (count < 5) {
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(20, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case CustomerSignUpPage:
customersignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case SignUpPage:
signUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}else{
paymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}
default:
break;
}
Browser.wait(testConfig, 3);
authDBHelper.verifyOTPTable(customer, otpRequestType, totalOtpSent, count, false, false);
} else {
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(68, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}else{
paymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}
default:
break;
}
Browser.wait(testConfig, 3);
authDBHelper.verifyOTPTable(customer, otpRequestType, totalOtpSent, count, true, false);
}
count++;
}
}
/**To get masked phone number
* @param mobileNo
* @return Masked phone number, e.g. for 9970232399->9xxxxxx399
*/
public String getMaskedNumberForOTP(String mobileNo){
String firstNumber = mobileNo.substring(0, 1);
String lastThreeNumber = mobileNo.substring(7, 10);
String maskedNumber = firstNumber+"xxxxxx"+lastThreeNumber;
return maskedNumber;
}
}
| UTF-8 | Java | 16,156 | java | OTPHelper.java | Java | []
| null | []
| package MoneyTestHelper;
import java.util.Map;
import MoneyPageObject.MobileApp.LoginScreen.ExpectedWelcomeScreen;
import Utils.Browser;
import Utils.Config;
import Utils.Helper;
import Utils.User;
import Utils.DatabaseHelper.AuthDBHelper;
import Utils.enums.database.AuthDB;
public class OTPHelper extends DashboardHelper{
private Config testConfig;
public enum ExpectedPage
{
WalletDashboardPage,ContactInformationPage,ReferralSignUpPage,PaymentLoginPage,OtpScreenOnApp,SignUpPage,CustomerSignUpPage
}
public OTPHelper(Config testConfig)
{
super(testConfig);
this.testConfig = testConfig;
}
/**
* This will click the Verify Button on Contact Information Page, Click on
* Resend OTP and check all the messages and DB
*
* @param Customer
* - Details of Customer
* @param totalOtpSent
* - Count of Total OTP Sent
* @param invalidCount
* - Count of Invalid OTP Entered
* @param OTPRequestType:
* - WalletRegisteration/ Adding Beneficiary/ Transfering Money To Bank
* @param ExpectedLandingPage:
* - Expected landing page
*/
public void verifyErrorMessageAndOTPTableOnRetryingOtp(User customer, int totalOtpSent, int invalidCount, OTPRequestType otpRequestType,
ExpectedPage expectedLandingPage) {
AuthDBHelper authDBHelper = new AuthDBHelper(testConfig);
Map<String, String> usersMapData = null;
int count = 2;
switch (expectedLandingPage) {
case ContactInformationPage:
contactInformationPage.clickVerifyBtnAndVerifySmsSentMessage(customer, totalOtpSent, invalidCount);
break;
case ReferralSignUpPage:
referralSignUpPage.fillCustomerRegistrationDetails(customer);
break;
case CustomerSignUpPage:
customersignUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case SignUpPage:
signUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
break;
default:
break;
}
while (count <= 6) {
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
break;
case ContactInformationPage:
contactInformationPage.clickResendOtp();
break;
case ReferralSignUpPage:
referralSignUpPage.clickResendOtp();
break;
case CustomerSignUpPage:
customersignUpPage.clickResendOtp();
break;
case SignUpPage:
signUpPage.clickResendOtp();
break;
case PaymentLoginPage:
if(testConfig.isMobile){
mobilePaymentLoginPage.clickResendOTPLink();;
}else{
paymentLoginPage.clickResendOTPLink();
}
break;
case OtpScreenOnApp:
otpScreen.clickOnResendOtpButton();
break;
default:
break;
}
if (count <= 5) {
Browser.wait(testConfig, 5);
String expectedSuccessMessage = null;
switch (expectedLandingPage) {
case WalletDashboardPage:
expectedSuccessMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(97, "Message String");
walletDashboardPage.verifyVerificationCodeSentMessageForOTP(expectedSuccessMessage);
break;
case ContactInformationPage:
expectedSuccessMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(64, "Message String");
String mobile = getMaskedNumberForOTP(customer.mobile);
testConfig.putRunTimeProperty("mobNum", mobile);
expectedSuccessMessage = Helper.replaceArgumentsWithRunTimeProperties(testConfig, expectedSuccessMessage);
contactInformationPage.verifySuccessMessageForOTP(expectedSuccessMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
/*case ReferralSignUpPage:
Browser.wait(testConfig, 3);
break;*/
case PaymentLoginPage:
expectedSuccessMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(64, "Message String");
testConfig.putRunTimeProperty("emailId", customer.userName);
if(testConfig.isMobile){
mobilePaymentLoginPage.verifySuccessMessageForOTP(customer,expectedSuccessMessage);
}else{
paymentLoginPage.verifySuccessMessageForOTP(customer,expectedSuccessMessage);
}
break;
default:
break;
}
authDBHelper.verifyOTPTable(customer, otpRequestType, count, invalidCount, false, false);
} else if (count > 5) {
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(72, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case CustomerSignUpPage:
customersignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case SignUpPage:
signUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyRetryErrorMessageForOTP();
}else{
paymentLoginPage.verifyRetryErrorMessageForOTP();
}
default:
break;
}
Browser.wait(testConfig, 2);
authDBHelper.verifyOTPTable(customer, otpRequestType, 5, invalidCount, false, false);
}
count++;
}
}
/**
* This will click the Verify Button on Contact Information Page, enter
* Expired OTP and check the messages
*
* @param Customer
* - Details of Customer
* @param totalOtpSent
* - Count of Total OTP Sent
* @param invalidCount
* - Count of Invalid OTP Entered
* @param OTPRequestType:
* - WalletRegisteration/ Adding Beneficiary/ Transfering Money To Bank
* @param ExpectedLandingPage:
* - Expected landing page
*/
public void verifyErrorMessageAndOTPTableOnEnteringExpiredOTP(User customer, int totalOtpSent, int invalidCount, OTPRequestType otpRequestType,
ExpectedPage expectedLandingPage) {
AuthDBHelper authDBHelper = new AuthDBHelper(testConfig);
Map<String, String> usersMapData = null;
switch (expectedLandingPage) {
case ContactInformationPage:
contactInformationPage.clickVerifyBtnAndVerifySmsSentMessage(customer, totalOtpSent, invalidCount);
break;
case ReferralSignUpPage:
referralSignUpPage.fillCustomerRegistrationDetails(customer);
break;
case CustomerSignUpPage:
customersignUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case SignUpPage:
signUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
Browser.wait(testConfig, 5);
break;
default:
break;
}
String Otpcode = authDBHelper.getDataFromOTPTable(customer.mobile, otpRequestType)
.get("otp");
switch (expectedLandingPage) {
case WalletDashboardPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
walletDashboardPage.clickActivateMyPayuMoneyWallet(Otpcode);
break;
case ContactInformationPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
contactInformationPage.clickVerifyBtn(Otpcode);
break;
case ReferralSignUpPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
referralSignUpPage.enterOTPAndClickSignUp(Otpcode,MoneyPageObject.Home.ReferralSignUpPage.ExpectedLandingPage.ReferralSignUpPage);
break;
case CustomerSignUpPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
customersignUpPage.enterOTPAndClickSignUp(customer, Otpcode,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case SignUpPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
signUpPage.enterOTPAndClickSignUp(customer, Otpcode,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case PaymentLoginPage:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
if(testConfig.isMobile)
{
mobilePaymentLoginPage.enterExpiredOtpAndClickQuickSignIn(Otpcode);
}else{
paymentLoginPage.enterExpiredOtpAndClickQuickSignIn(Otpcode);
}
break;
case OtpScreenOnApp:
authDBHelper.updateExpiryDateOfOTPTable(customer, otpRequestType);
otpScreen.enterOtp(Otpcode).clickActivate(ExpectedWelcomeScreen.OtpScreen);
default:
break;
}
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(71, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case SignUpPage:
signUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case CustomerSignUpPage:
customersignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyExpiredOtpErrorMessage(expectedErrorMessage);
}else{
paymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}
default:
break;
}
}
/**
* This will click the Verify Button on Contact Information Page, enter OTP
* and verify DB and different Messages
*
* @param Customer
* - Details of Customer
* @param totalOtpSent
* - Count of Total OTP Sent
* @param invalidCount
* - Count of Invalid OTP Entered
* @param OTPRequestType:
* - WalletRegisteration/ Adding Beneficiary/ Transfering Money To Bank
* @param ExpectedLandingPage:
* - Expected landing page
*/
public void verifyErrorMessageAndOTPTableOnEnteringInvalidOTP(User customer, int totalOtpSent, int invalidCount, OTPRequestType otpRequestType,
ExpectedPage expectedLandingPage) {
int count = 1;
AuthDBHelper authDBHelper = new AuthDBHelper(testConfig);
Map<String, String> usersMapData = null;
switch (expectedLandingPage) {
case ContactInformationPage:
contactInformationPage.clickVerifyBtnAndVerifySmsSentMessage(customer, totalOtpSent, invalidCount);
break;
case ReferralSignUpPage:
referralSignUpPage.fillCustomerRegistrationDetails(customer);
break;
case CustomerSignUpPage:
customersignUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case SignUpPage:
signUpPage.fillRegistrationDetails(customer, MoneyPageObject.Home.SignUpPage.UserType.Customer, null); // null for referralCode
break;
case WalletDashboardPage:
walletDashboardPage.enterWalletName(customer).clickSendOrResendOtp();
break;
default:
break;
}
while (count <= 5) {
String invalidOtp = Helper.generateRandomNumber(6) + "";
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.clickActivateMyPayuMoneyWallet(invalidOtp);
break;
case ContactInformationPage:
contactInformationPage.clickVerifyBtn(invalidOtp);
break;
case ReferralSignUpPage:
referralSignUpPage.enterOTPAndClickSignUp(invalidOtp,MoneyPageObject.Home.ReferralSignUpPage.ExpectedLandingPage.ReferralSignUpPage);
break;
case CustomerSignUpPage:
customersignUpPage.enterOTPAndClickSignUp(customer, invalidOtp,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case SignUpPage:
signUpPage.enterOTPAndClickSignUp(customer, invalidOtp,MoneyPageObject.Home.SignUpPage.ExpectedLandingPage.SignUpPage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.enterInvalidOtp();
}else{
paymentLoginPage.enterInvalidOtpAndClickSignInBtn();
}
break;
case OtpScreenOnApp:
otpScreen.enterOtp(invalidOtp).clickActivate(ExpectedWelcomeScreen.OtpScreen);
break;
default:
break;
}
if (count < 5) {
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(20, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case CustomerSignUpPage:
customersignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case SignUpPage:
signUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}else{
paymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}
default:
break;
}
Browser.wait(testConfig, 3);
authDBHelper.verifyOTPTable(customer, otpRequestType, totalOtpSent, count, false, false);
} else {
String expectedErrorMessage = testConfig.getCachedTestDataReaderObject("UIMessages")
.GetData(68, "Message String");
switch (expectedLandingPage) {
case WalletDashboardPage:
walletDashboardPage.verifyErrorMessageForOTP(expectedErrorMessage);
break;
case ContactInformationPage:
contactInformationPage.verifyErrorMessageForOTP(expectedErrorMessage);
usersMapData = authDBHelper.getUserDataDynamically(AuthDB.users.email.toString(), customer.userName);
Helper.compareEquals(testConfig, "Mobile Verification Status", "0", usersMapData.get("mobileVerificationStatus"));
break;
case ReferralSignUpPage:
referralSignUpPage.verifyMessageForOTP(expectedErrorMessage);
break;
case PaymentLoginPage:
if(testConfig.isMobile)
{
mobilePaymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}else{
paymentLoginPage.verifyErrorResponseMessage(expectedErrorMessage);
}
default:
break;
}
Browser.wait(testConfig, 3);
authDBHelper.verifyOTPTable(customer, otpRequestType, totalOtpSent, count, true, false);
}
count++;
}
}
/**To get masked phone number
* @param mobileNo
* @return Masked phone number, e.g. for 9970232399->9xxxxxx399
*/
public String getMaskedNumberForOTP(String mobileNo){
String firstNumber = mobileNo.substring(0, 1);
String lastThreeNumber = mobileNo.substring(7, 10);
String maskedNumber = firstNumber+"xxxxxx"+lastThreeNumber;
return maskedNumber;
}
}
| 16,156 | 0.756004 | 0.752723 | 444 | 35.387386 | 33.542744 | 144 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.925676 | false | false | 0 |
3c3b5deb5832d09217c06d0063fa2875ed7b9c7a | 23,038,204,582,622 | 1946b53423645b2cb8c381eb6c27b34f4d198e34 | /spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java | 64aa0a2f263fc35510e95d178bd3751fa26e4e77 | [
"Apache-2.0"
]
| permissive | spring-projects/spring-framework | https://github.com/spring-projects/spring-framework | e0bf18593af55a5cddd57efbb86ebe5da8a8f38e | 759e3d4aa6e4e8154f6428e496275bcd89431bba | refs/heads/main | 2023-09-03T07:44:34.908000 | 2023-09-03T00:32:01 | 2023-09-03T00:32:01 | 1,148,753 | 56,403 | 43,516 | Apache-2.0 | false | 2023-09-14T15:45:05 | 2010-12-08T04:04:45 | 2023-09-14T13:57:45 | 2023-09-14T15:45:03 | 197,376 | 53,106 | 36,868 | 1,183 | Java | false | false | /*
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context.annotation;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
/**
* {@link BeanNameGenerator} implementation for bean classes annotated with the
* {@link org.springframework.stereotype.Component @Component} annotation or
* with another annotation that is itself annotated with {@code @Component} as a
* meta-annotation. For example, Spring's stereotype annotations (such as
* {@link org.springframework.stereotype.Repository @Repository}) are
* themselves annotated with {@code @Component}.
*
* <p>Also supports Jakarta EE's {@link jakarta.annotation.ManagedBean} and
* JSR-330's {@link jakarta.inject.Named} annotations (as well as their pre-Jakarta
* {@code javax.annotation.ManagedBean} and {@code javax.inject.Named} equivalents),
* if available. Note that Spring component annotations always override such
* standard annotations.
*
* <p>If the annotation's value doesn't indicate a bean name, an appropriate
* name will be built based on the short name of the class (with the first
* letter lower-cased), unless the first two letters are uppercase. For example:
*
* <pre class="code">com.xyz.FooServiceImpl -> fooServiceImpl</pre>
* <pre class="code">com.xyz.URLFooServiceImpl -> URLFooServiceImpl</pre>
*
* @author Juergen Hoeller
* @author Mark Fisher
* @author Sam Brannen
* @since 2.5
* @see org.springframework.stereotype.Component#value()
* @see org.springframework.stereotype.Repository#value()
* @see org.springframework.stereotype.Service#value()
* @see org.springframework.stereotype.Controller#value()
* @see jakarta.inject.Named#value()
* @see FullyQualifiedAnnotationBeanNameGenerator
*/
public class AnnotationBeanNameGenerator implements BeanNameGenerator {
/**
* A convenient constant for a default {@code AnnotationBeanNameGenerator} instance,
* as used for component scanning purposes.
* @since 5.2
*/
public static final AnnotationBeanNameGenerator INSTANCE = new AnnotationBeanNameGenerator();
private static final String COMPONENT_ANNOTATION_CLASSNAME = "org.springframework.stereotype.Component";
/**
* Set used to track which stereotype annotations have already been checked
* to see if they use a convention-based override for the {@code value}
* attribute in {@code @Component}.
* @since 6.1
* @see #determineBeanNameFromAnnotation(AnnotatedBeanDefinition)
*/
private static final Set<String> conventionBasedStereotypeCheckCache = ConcurrentHashMap.newKeySet();
private final Log logger = LogFactory.getLog(AnnotationBeanNameGenerator.class);
private final Map<String, Set<String>> metaAnnotationTypesCache = new ConcurrentHashMap<>();
@Override
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
if (definition instanceof AnnotatedBeanDefinition annotatedBeanDefinition) {
String beanName = determineBeanNameFromAnnotation(annotatedBeanDefinition);
if (StringUtils.hasText(beanName)) {
// Explicit bean name found.
return beanName;
}
}
// Fallback: generate a unique default bean name.
return buildDefaultBeanName(definition, registry);
}
/**
* Derive a bean name from one of the annotations on the class.
* @param annotatedDef the annotation-aware bean definition
* @return the bean name, or {@code null} if none is found
*/
@Nullable
protected String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef) {
AnnotationMetadata metadata = annotatedDef.getMetadata();
String beanName = getExplicitBeanName(metadata);
if (beanName != null) {
return beanName;
}
for (String annotationType : metadata.getAnnotationTypes()) {
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, annotationType);
if (attributes != null) {
Set<String> metaAnnotationTypes = this.metaAnnotationTypesCache.computeIfAbsent(annotationType, key -> {
Set<String> result = metadata.getMetaAnnotationTypes(key);
return (result.isEmpty() ? Collections.emptySet() : result);
});
if (isStereotypeWithNameValue(annotationType, metaAnnotationTypes, attributes)) {
Object value = attributes.get("value");
if (value instanceof String currentName && !currentName.isBlank()) {
if (conventionBasedStereotypeCheckCache.add(annotationType) &&
metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) && logger.isWarnEnabled()) {
logger.warn("""
Support for convention-based stereotype names is deprecated and will \
be removed in a future version of the framework. Please annotate the \
'value' attribute in @%s with @AliasFor(annotation=Component.class) \
to declare an explicit alias for @Component's 'value' attribute."""
.formatted(annotationType));
}
if (beanName != null && !currentName.equals(beanName)) {
throw new IllegalStateException("Stereotype annotations suggest inconsistent " +
"component names: '" + beanName + "' versus '" + currentName + "'");
}
beanName = currentName;
}
}
}
}
return beanName;
}
/**
* Get the explicit bean name for the underlying class, as configured via
* {@link org.springframework.stereotype.Component @Component} and taking into
* account {@link org.springframework.core.annotation.AliasFor @AliasFor}
* semantics for annotation attribute overrides for {@code @Component}'s
* {@code value} attribute.
* @param metadata the {@link AnnotationMetadata} for the underlying class
* @return the explicit bean name, or {@code null} if not found
* @since 6.1
* @see org.springframework.stereotype.Component#value()
*/
@Nullable
private String getExplicitBeanName(AnnotationMetadata metadata) {
List<String> names = metadata.getAnnotations().stream(COMPONENT_ANNOTATION_CLASSNAME)
.map(annotation -> annotation.getString(MergedAnnotation.VALUE))
.filter(StringUtils::hasText)
.map(String::trim)
.distinct()
.toList();
if (names.size() == 1) {
return names.get(0);
}
if (names.size() > 1) {
throw new IllegalStateException(
"Stereotype annotations suggest inconsistent component names: " + names);
}
return null;
}
/**
* Check whether the given annotation is a stereotype that is allowed
* to suggest a component name through its {@code value()} attribute.
* @param annotationType the name of the annotation class to check
* @param metaAnnotationTypes the names of meta-annotations on the given annotation
* @param attributes the map of attributes for the given annotation
* @return whether the annotation qualifies as a stereotype with component name
*/
protected boolean isStereotypeWithNameValue(String annotationType,
Set<String> metaAnnotationTypes, @Nullable Map<String, Object> attributes) {
boolean isStereotype = metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) ||
annotationType.equals("jakarta.annotation.ManagedBean") ||
annotationType.equals("javax.annotation.ManagedBean") ||
annotationType.equals("jakarta.inject.Named") ||
annotationType.equals("javax.inject.Named");
return (isStereotype && attributes != null && attributes.containsKey("value"));
}
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation delegates to {@link #buildDefaultBeanName(BeanDefinition)}.
* @param definition the bean definition to build a bean name for
* @param registry the registry that the given bean definition is being registered with
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
return buildDefaultBeanName(definition);
}
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation simply builds a decapitalized version
* of the short class name: e.g. "mypackage.MyJdbcDao" → "myJdbcDao".
* <p>Note that inner classes will thus have names of the form
* "outerClassName.InnerClassName", which because of the period in the
* name may be an issue if you are autowiring by name.
* @param definition the bean definition to build a bean name for
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition) {
String beanClassName = definition.getBeanClassName();
Assert.state(beanClassName != null, "No bean class name set");
String shortClassName = ClassUtils.getShortName(beanClassName);
return StringUtils.uncapitalizeAsProperty(shortClassName);
}
}
| UTF-8 | Java | 10,050 | java | AnnotationBeanNameGenerator.java | Java | [
{
"context": "ceImpl -> URLFooServiceImpl</pre>\n *\n * @author Juergen Hoeller\n * @author Mark Fisher\n * @author Sam Brannen\n * ",
"end": 2741,
"score": 0.9998589754104614,
"start": 2726,
"tag": "NAME",
"value": "Juergen Hoeller"
},
{
"context": "mpl</pre>\n *\n * @author Juergen Hoeller\n * @author Mark Fisher\n * @author Sam Brannen\n * @since 2.5\n * @see org.",
"end": 2764,
"score": 0.9998245239257812,
"start": 2753,
"tag": "NAME",
"value": "Mark Fisher"
},
{
"context": " Juergen Hoeller\n * @author Mark Fisher\n * @author Sam Brannen\n * @since 2.5\n * @see org.springframework.stereot",
"end": 2787,
"score": 0.9998489022254944,
"start": 2776,
"tag": "NAME",
"value": "Sam Brannen"
}
]
| null | []
| /*
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context.annotation;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
/**
* {@link BeanNameGenerator} implementation for bean classes annotated with the
* {@link org.springframework.stereotype.Component @Component} annotation or
* with another annotation that is itself annotated with {@code @Component} as a
* meta-annotation. For example, Spring's stereotype annotations (such as
* {@link org.springframework.stereotype.Repository @Repository}) are
* themselves annotated with {@code @Component}.
*
* <p>Also supports Jakarta EE's {@link jakarta.annotation.ManagedBean} and
* JSR-330's {@link jakarta.inject.Named} annotations (as well as their pre-Jakarta
* {@code javax.annotation.ManagedBean} and {@code javax.inject.Named} equivalents),
* if available. Note that Spring component annotations always override such
* standard annotations.
*
* <p>If the annotation's value doesn't indicate a bean name, an appropriate
* name will be built based on the short name of the class (with the first
* letter lower-cased), unless the first two letters are uppercase. For example:
*
* <pre class="code">com.xyz.FooServiceImpl -> fooServiceImpl</pre>
* <pre class="code">com.xyz.URLFooServiceImpl -> URLFooServiceImpl</pre>
*
* @author <NAME>
* @author <NAME>
* @author <NAME>
* @since 2.5
* @see org.springframework.stereotype.Component#value()
* @see org.springframework.stereotype.Repository#value()
* @see org.springframework.stereotype.Service#value()
* @see org.springframework.stereotype.Controller#value()
* @see jakarta.inject.Named#value()
* @see FullyQualifiedAnnotationBeanNameGenerator
*/
public class AnnotationBeanNameGenerator implements BeanNameGenerator {
/**
* A convenient constant for a default {@code AnnotationBeanNameGenerator} instance,
* as used for component scanning purposes.
* @since 5.2
*/
public static final AnnotationBeanNameGenerator INSTANCE = new AnnotationBeanNameGenerator();
private static final String COMPONENT_ANNOTATION_CLASSNAME = "org.springframework.stereotype.Component";
/**
* Set used to track which stereotype annotations have already been checked
* to see if they use a convention-based override for the {@code value}
* attribute in {@code @Component}.
* @since 6.1
* @see #determineBeanNameFromAnnotation(AnnotatedBeanDefinition)
*/
private static final Set<String> conventionBasedStereotypeCheckCache = ConcurrentHashMap.newKeySet();
private final Log logger = LogFactory.getLog(AnnotationBeanNameGenerator.class);
private final Map<String, Set<String>> metaAnnotationTypesCache = new ConcurrentHashMap<>();
@Override
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
if (definition instanceof AnnotatedBeanDefinition annotatedBeanDefinition) {
String beanName = determineBeanNameFromAnnotation(annotatedBeanDefinition);
if (StringUtils.hasText(beanName)) {
// Explicit bean name found.
return beanName;
}
}
// Fallback: generate a unique default bean name.
return buildDefaultBeanName(definition, registry);
}
/**
* Derive a bean name from one of the annotations on the class.
* @param annotatedDef the annotation-aware bean definition
* @return the bean name, or {@code null} if none is found
*/
@Nullable
protected String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef) {
AnnotationMetadata metadata = annotatedDef.getMetadata();
String beanName = getExplicitBeanName(metadata);
if (beanName != null) {
return beanName;
}
for (String annotationType : metadata.getAnnotationTypes()) {
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, annotationType);
if (attributes != null) {
Set<String> metaAnnotationTypes = this.metaAnnotationTypesCache.computeIfAbsent(annotationType, key -> {
Set<String> result = metadata.getMetaAnnotationTypes(key);
return (result.isEmpty() ? Collections.emptySet() : result);
});
if (isStereotypeWithNameValue(annotationType, metaAnnotationTypes, attributes)) {
Object value = attributes.get("value");
if (value instanceof String currentName && !currentName.isBlank()) {
if (conventionBasedStereotypeCheckCache.add(annotationType) &&
metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) && logger.isWarnEnabled()) {
logger.warn("""
Support for convention-based stereotype names is deprecated and will \
be removed in a future version of the framework. Please annotate the \
'value' attribute in @%s with @AliasFor(annotation=Component.class) \
to declare an explicit alias for @Component's 'value' attribute."""
.formatted(annotationType));
}
if (beanName != null && !currentName.equals(beanName)) {
throw new IllegalStateException("Stereotype annotations suggest inconsistent " +
"component names: '" + beanName + "' versus '" + currentName + "'");
}
beanName = currentName;
}
}
}
}
return beanName;
}
/**
* Get the explicit bean name for the underlying class, as configured via
* {@link org.springframework.stereotype.Component @Component} and taking into
* account {@link org.springframework.core.annotation.AliasFor @AliasFor}
* semantics for annotation attribute overrides for {@code @Component}'s
* {@code value} attribute.
* @param metadata the {@link AnnotationMetadata} for the underlying class
* @return the explicit bean name, or {@code null} if not found
* @since 6.1
* @see org.springframework.stereotype.Component#value()
*/
@Nullable
private String getExplicitBeanName(AnnotationMetadata metadata) {
List<String> names = metadata.getAnnotations().stream(COMPONENT_ANNOTATION_CLASSNAME)
.map(annotation -> annotation.getString(MergedAnnotation.VALUE))
.filter(StringUtils::hasText)
.map(String::trim)
.distinct()
.toList();
if (names.size() == 1) {
return names.get(0);
}
if (names.size() > 1) {
throw new IllegalStateException(
"Stereotype annotations suggest inconsistent component names: " + names);
}
return null;
}
/**
* Check whether the given annotation is a stereotype that is allowed
* to suggest a component name through its {@code value()} attribute.
* @param annotationType the name of the annotation class to check
* @param metaAnnotationTypes the names of meta-annotations on the given annotation
* @param attributes the map of attributes for the given annotation
* @return whether the annotation qualifies as a stereotype with component name
*/
protected boolean isStereotypeWithNameValue(String annotationType,
Set<String> metaAnnotationTypes, @Nullable Map<String, Object> attributes) {
boolean isStereotype = metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) ||
annotationType.equals("jakarta.annotation.ManagedBean") ||
annotationType.equals("javax.annotation.ManagedBean") ||
annotationType.equals("jakarta.inject.Named") ||
annotationType.equals("javax.inject.Named");
return (isStereotype && attributes != null && attributes.containsKey("value"));
}
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation delegates to {@link #buildDefaultBeanName(BeanDefinition)}.
* @param definition the bean definition to build a bean name for
* @param registry the registry that the given bean definition is being registered with
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
return buildDefaultBeanName(definition);
}
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation simply builds a decapitalized version
* of the short class name: e.g. "mypackage.MyJdbcDao" → "myJdbcDao".
* <p>Note that inner classes will thus have names of the form
* "outerClassName.InnerClassName", which because of the period in the
* name may be an issue if you are autowiring by name.
* @param definition the bean definition to build a bean name for
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition) {
String beanClassName = definition.getBeanClassName();
Assert.state(beanClassName != null, "No bean class name set");
String shortClassName = ClassUtils.getShortName(beanClassName);
return StringUtils.uncapitalizeAsProperty(shortClassName);
}
}
| 10,031 | 0.75592 | 0.753333 | 234 | 41.948719 | 32.225395 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.858974 | false | false | 0 |
2ac220b408b7d2c5cb533766a146808d1137ac90 | 12,154,757,488,588 | c3ed94e1e761a369a893e8f5b73b2fc83628ea37 | /ST-BLE-Mesh_App/app/src/main/java/com/st/bluenrgmesh/adapter/config/ConfigElementRecyclerAdapter.java | 02f8bc203e47b55939f03494196123ebc625f4af | []
| no_license | rawatsaurabh/stblemesh | https://github.com/rawatsaurabh/stblemesh | 8b2e023e0c18b980d99b65ffb3f6598d39b7b46a | b049c9d1fbd306cb002a9286e06e8cabd68f80d0 | refs/heads/master | 2022-10-23T01:15:35.898000 | 2020-06-16T08:17:32 | 2020-06-16T08:17:32 | 256,130,491 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
******************************************************************************
* @file ConfigElementRecyclerAdapter.java
* @author BLE Mesh Team
* @version V1.11.000
* @date 20-October-2019
* @brief User Application file
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* BlueNRG-Mesh is based on Motorola’s Mesh Over Bluetooth Low Energy (MoBLE)
* technology. STMicroelectronics has done suitable updates in the firmware
* and Android Mesh layers suitably.
*
******************************************************************************
*/
package com.st.bluenrgmesh.adapter.config;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.st.bluenrgmesh.MainActivity;
import com.st.bluenrgmesh.R;
import com.st.bluenrgmesh.Utils;
import com.st.bluenrgmesh.models.meshdata.Nodes;
import com.st.bluenrgmesh.view.fragments.setting.configuration.ConfigurationFragment;
public class ConfigElementRecyclerAdapter extends RecyclerView.Adapter<ConfigElementRecyclerAdapter.ViewHolder> {
private Context context;
private Nodes node;
private IRecyclerViewHolderClicks listener;
public ConfigElementRecyclerAdapter(Context context, Nodes node, IRecyclerViewHolderClicks iRecyclerViewHolderClicks) {
this.context = context;
this.node = node;
this.listener = iRecyclerViewHolderClicks;
}
public interface IRecyclerViewHolderClicks {
void notifyAdapter(int position);
}
@Override
public ConfigElementRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_config_element, parent, false);
ConfigElementRecyclerAdapter.ViewHolder vh = new ConfigElementRecyclerAdapter.ViewHolder(v);
return vh;
}
@Override
public void onBindViewHolder(ConfigElementRecyclerAdapter.ViewHolder holder, final int position) {
holder.txtElement.setText(node.getElements().get(position).getElementName());
if(node.getElements().get(position).isConfigured)
{
holder.txtConfig.setText("Configured");
holder.txtConfig.setTextColor(context.getResources().getColor(R.color.tv));
holder.txtElement.setTextColor(context.getResources().getColor(R.color.tv));
}
holder.lytconfig.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.notifyAdapter(position);
/*if(!node.getElements().get(position).isConfigured)
{
Utils.moveToFragment((MainActivity)context, new ConfigurationFragment(), node, 0);
}*/
}
});
}
@Override
public int getItemCount() {
return node.getElements().size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private RelativeLayout lytconfig;
private TextView txtElement;
private TextView txtConfig;
public ViewHolder(View itemView) {
super(itemView);
lytconfig = (RelativeLayout) itemView.findViewById(R.id.lytconfig);
txtElement = (TextView) itemView.findViewById(R.id.txtElement);
txtConfig = (TextView) itemView.findViewById(R.id.txtConfig);
}
}
}
| UTF-8 | Java | 5,198 | java | ConfigElementRecyclerAdapter.java | Java | []
| null | []
| /**
******************************************************************************
* @file ConfigElementRecyclerAdapter.java
* @author BLE Mesh Team
* @version V1.11.000
* @date 20-October-2019
* @brief User Application file
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* BlueNRG-Mesh is based on Motorola’s Mesh Over Bluetooth Low Energy (MoBLE)
* technology. STMicroelectronics has done suitable updates in the firmware
* and Android Mesh layers suitably.
*
******************************************************************************
*/
package com.st.bluenrgmesh.adapter.config;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.st.bluenrgmesh.MainActivity;
import com.st.bluenrgmesh.R;
import com.st.bluenrgmesh.Utils;
import com.st.bluenrgmesh.models.meshdata.Nodes;
import com.st.bluenrgmesh.view.fragments.setting.configuration.ConfigurationFragment;
public class ConfigElementRecyclerAdapter extends RecyclerView.Adapter<ConfigElementRecyclerAdapter.ViewHolder> {
private Context context;
private Nodes node;
private IRecyclerViewHolderClicks listener;
public ConfigElementRecyclerAdapter(Context context, Nodes node, IRecyclerViewHolderClicks iRecyclerViewHolderClicks) {
this.context = context;
this.node = node;
this.listener = iRecyclerViewHolderClicks;
}
public interface IRecyclerViewHolderClicks {
void notifyAdapter(int position);
}
@Override
public ConfigElementRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_config_element, parent, false);
ConfigElementRecyclerAdapter.ViewHolder vh = new ConfigElementRecyclerAdapter.ViewHolder(v);
return vh;
}
@Override
public void onBindViewHolder(ConfigElementRecyclerAdapter.ViewHolder holder, final int position) {
holder.txtElement.setText(node.getElements().get(position).getElementName());
if(node.getElements().get(position).isConfigured)
{
holder.txtConfig.setText("Configured");
holder.txtConfig.setTextColor(context.getResources().getColor(R.color.tv));
holder.txtElement.setTextColor(context.getResources().getColor(R.color.tv));
}
holder.lytconfig.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.notifyAdapter(position);
/*if(!node.getElements().get(position).isConfigured)
{
Utils.moveToFragment((MainActivity)context, new ConfigurationFragment(), node, 0);
}*/
}
});
}
@Override
public int getItemCount() {
return node.getElements().size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private RelativeLayout lytconfig;
private TextView txtElement;
private TextView txtConfig;
public ViewHolder(View itemView) {
super(itemView);
lytconfig = (RelativeLayout) itemView.findViewById(R.id.lytconfig);
txtElement = (TextView) itemView.findViewById(R.id.txtElement);
txtConfig = (TextView) itemView.findViewById(R.id.txtConfig);
}
}
}
| 5,198 | 0.689184 | 0.68495 | 129 | 39.279068 | 33.784538 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.542636 | false | false | 0 |
3699dc1b2f7ee118788ba53089b4869c1d6e8b15 | 3,058,016,729,891 | 4c55604241121510b8cce871a1916ebd31ba646b | /TrueWheelsOnline/src/main/java/com/Truewheels/util/Truewheels.java | 9d4c06a5ccf00071b920f6d4a0b9640fba8b8a75 | []
| no_license | archana07knmiet/TestProject | https://github.com/archana07knmiet/TestProject | b1323bfa1731725cbf6e2a031b3b559a42e7279c | f7fea0616c9fb930992432c525ec091195b73d75 | refs/heads/master | 2020-12-09T16:51:44.395000 | 2020-01-12T09:01:32 | 2020-01-12T09:01:32 | 233,362,702 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.Truewheels.util;
public interface Truewheels {
}
| UTF-8 | Java | 63 | java | Truewheels.java | Java | []
| null | []
| package com.Truewheels.util;
public interface Truewheels {
}
| 63 | 0.777778 | 0.777778 | 5 | 11.6 | 13.807244 | 29 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 0 |
394d33c2f0e9a741f2c55d116621948c02625dbe | 14,912,126,459,249 | 5e4ff4da6d828a3c16ca1f705879bfdd3c578d6c | /les2/GuessStarter.java | d726e946c4ac57bfbe292ab89b49a3e5d1e53c96 | []
| no_license | downstreamfish/Java_Trains | https://github.com/downstreamfish/Java_Trains | bf85abfbcc0c23cf49112282ce913729bd49a5ac | aee9d4e6d1f3ce3f735c97ac180979a11cdb5c06 | refs/heads/master | 2020-03-27T14:36:08.666000 | 2018-09-15T23:09:10 | 2018-09-15T23:09:10 | 146,671,776 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.Random;
import java.util.Scanner;
public class GuessStarter
{
public static void main(String[] args){
Random random = new Random();
Scanner in = new Scanner(System.in);
int number = random.nextInt(100) + 1;
//System.out.println(number);
System.out.print("I'm thinking of a number between 1 and 100\n" +
"(including both). Can you guess what it is?\n");
System.out.print("Type a number: ");
int guess = in.nextInt();
System.out.printf("You guess is %d\n", guess);
System.out.printf("The number I was thinking of is: %d\n", number);
System.out.printf("You were off by: %d\n", guess - number);
}
}
| UTF-8 | Java | 641 | java | GuessStarter.java | Java | []
| null | []
| import java.util.Random;
import java.util.Scanner;
public class GuessStarter
{
public static void main(String[] args){
Random random = new Random();
Scanner in = new Scanner(System.in);
int number = random.nextInt(100) + 1;
//System.out.println(number);
System.out.print("I'm thinking of a number between 1 and 100\n" +
"(including both). Can you guess what it is?\n");
System.out.print("Type a number: ");
int guess = in.nextInt();
System.out.printf("You guess is %d\n", guess);
System.out.printf("The number I was thinking of is: %d\n", number);
System.out.printf("You were off by: %d\n", guess - number);
}
}
| 641 | 0.675507 | 0.663027 | 21 | 29.523809 | 22.115753 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.952381 | false | false | 0 |
e071342239e632b794a5f03ab0da87c218e4ceb6 | 28,716,151,358,402 | 86f1c95855d828da547294221541afb66bad151a | /src/main/java/usa/browntrask/utility/impl/tables/TableFactoryImpl.java | a1ad91daead4fb7daa42e00a8facb5f86e5d2de1 | []
| no_license | ian-a-brown/utility | https://github.com/ian-a-brown/utility | 28b2b58938fa59990ea150216074b1a13be17f18 | e4a6060b21316fa9f330ea915ee2156d87137afb | refs/heads/master | 2021-01-12T01:52:01.478000 | 2019-12-18T01:28:27 | 2019-12-18T01:28:27 | 78,437,774 | 0 | 0 | null | false | 2020-10-12T23:20:28 | 2017-01-09T14:47:49 | 2019-12-18T01:29:08 | 2020-10-12T23:20:27 | 101 | 0 | 0 | 1 | Java | false | false | /**
* Copyright 2007, 2008, 2009, 2010, 2011 by Ian Andrew Brown<br>
* All Rights Reserved
*/
package usa.browntrask.utility.impl.tables;
import usa.browntrask.utility.tables.Table;
import usa.browntrask.utility.tables.TableFactory;
/**
* Factory object to create Table objects for the game of En Garde.
* <p>
*
* @author Ian Andrew Brown
* @since V0.1.1 Nov 7, 2007
* @version Jul 26, 2018
*/
public enum TableFactoryImpl implements TableFactory {
/**
* the singleton instance of the factory.
* <p>
*
* @author Ian Andrew Brown
* @since V0.1.1 Jul 13, 2008
* @version Jul 13, 2008
*/
INSTANCE;
/**
* Gets an instance of the factory.
* <p>
*
* @author Ian Andrew Brown
* @return the factory instance.
* @since V0.1.1 Aug 8, 2009
* @version Aug 8, 2009
*/
public final static TableFactory getInstance() {
return INSTANCE;
}
/** {@inheritDoc} */
@Override
public final Table createTable(final String tableName) {
return new TableImpl(tableName);
}
}
| UTF-8 | Java | 1,009 | java | TableFactoryImpl.java | Java | [
{
"context": "/**\n * Copyright 2007, 2008, 2009, 2010, 2011 by Ian Andrew Brown<br>\n * All Rights Reserved\n */\npackage usa.brownt",
"end": 65,
"score": 0.9998878836631775,
"start": 49,
"tag": "NAME",
"value": "Ian Andrew Brown"
},
{
"context": "ts for the game of En Garde.\n * <p>\n * \n * @author Ian Andrew Brown\n * @since V0.1.1 Nov 7, 2007\n * @version Jul 26, ",
"end": 348,
"score": 0.9998847246170044,
"start": 332,
"tag": "NAME",
"value": "Ian Andrew Brown"
},
{
"context": " instance of the factory.\n\t * <p>\n\t * \n\t * @author Ian Andrew Brown\n\t * @since V0.1.1 Jul 13, 2008\n\t * @version Jul 1",
"end": 552,
"score": 0.9998820424079895,
"start": 536,
"tag": "NAME",
"value": "Ian Andrew Brown"
},
{
"context": " instance of the factory.\n\t * <p>\n\t * \n\t * @author Ian Andrew Brown\n\t * @return the factory instance.\n\t * @since V0.1",
"end": 710,
"score": 0.9998856782913208,
"start": 694,
"tag": "NAME",
"value": "Ian Andrew Brown"
}
]
| null | []
| /**
* Copyright 2007, 2008, 2009, 2010, 2011 by <NAME><br>
* All Rights Reserved
*/
package usa.browntrask.utility.impl.tables;
import usa.browntrask.utility.tables.Table;
import usa.browntrask.utility.tables.TableFactory;
/**
* Factory object to create Table objects for the game of En Garde.
* <p>
*
* @author <NAME>
* @since V0.1.1 Nov 7, 2007
* @version Jul 26, 2018
*/
public enum TableFactoryImpl implements TableFactory {
/**
* the singleton instance of the factory.
* <p>
*
* @author <NAME>
* @since V0.1.1 Jul 13, 2008
* @version Jul 13, 2008
*/
INSTANCE;
/**
* Gets an instance of the factory.
* <p>
*
* @author <NAME>
* @return the factory instance.
* @since V0.1.1 Aug 8, 2009
* @version Aug 8, 2009
*/
public final static TableFactory getInstance() {
return INSTANCE;
}
/** {@inheritDoc} */
@Override
public final Table createTable(final String tableName) {
return new TableImpl(tableName);
}
}
| 969 | 0.673935 | 0.612488 | 48 | 20.020834 | 19.297548 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.916667 | false | false | 0 |
860e1cee09fc12f60d49a89f9e1ab8bb46a3408e | 13,314,398,657,229 | 8557a8859d8f7902e4a9935581eb276e05242841 | /src/MxCompiler/Optim/LoopOptim/LoopAnalysis.java | bc82a9239791881d3f7019126885b1845f3e3c7b | []
| no_license | MasterJH5574/Mx-Compiler | https://github.com/MasterJH5574/Mx-Compiler | 6d4f5d7ded24f7e681d9b3f44cceca006c11d0e5 | 5cb95321f3b5cbc095fc6c1665c1c6452aa210a2 | refs/heads/master | 2020-12-09T02:42:00.106000 | 2020-05-16T14:37:47 | 2020-05-16T14:37:47 | 233,164,997 | 15 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package MxCompiler.Optim.LoopOptim;
import MxCompiler.IR.BasicBlock;
import MxCompiler.IR.Function;
import MxCompiler.IR.Instruction.BranchInst;
import MxCompiler.IR.Instruction.IRInstruction;
import MxCompiler.IR.Instruction.PhiInst;
import MxCompiler.IR.Module;
import MxCompiler.IR.Operand.*;
import MxCompiler.Optim.Pass;
import MxCompiler.Utilities.Pair;
import java.util.*;
public class LoopAnalysis extends Pass {
static public class LoopNode {
static LoopAnalysis loopAnalysis;
private BasicBlock header;
private Set<BasicBlock> loopBlocks;
private Set<BasicBlock> uniqueLoopBlocks;
private Set<BasicBlock> exitBlocks;
private LoopNode father;
private ArrayList<LoopNode> children;
private int depth;
private BasicBlock preHeader;
public LoopNode(BasicBlock header) {
this.header = header;
this.loopBlocks = new HashSet<>();
this.uniqueLoopBlocks = null;
this.exitBlocks = null;
this.father = null;
this.children = new ArrayList<>();
this.depth = 0;
this.preHeader = null;
}
public void addLoopBlock(BasicBlock block) {
this.loopBlocks.add(block);
}
public Set<BasicBlock> getLoopBlocks() {
return loopBlocks;
}
public Set<BasicBlock> getUniqueLoopBlocks() {
return uniqueLoopBlocks;
}
public Set<BasicBlock> getExitBlocks() {
return exitBlocks;
}
public void setExitBlocks(Set<BasicBlock> exitBlocks) {
this.exitBlocks = exitBlocks;
}
public void setFather(LoopNode father) {
this.father = father;
}
public boolean hasFather() {
return father != null;
}
public void addChild(LoopNode child) {
children.add(child);
}
public ArrayList<LoopNode> getChildren() {
return children;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
public boolean hasPreHeader(Map<BasicBlock, LoopNode> blockNodeMap) {
if (preHeader != null)
return true;
/*
* If header has only one predecessor out of block,
* and the only predecessor has only one successor(header),
* then we can mark the only predecessor as preHeader.
*/
int predecessorCnt = 0;
int successorCnt = 0;
BasicBlock mayPreHeader = null;
for (BasicBlock predecessor : header.getPredecessors()) {
if (loopBlocks.contains(predecessor))
continue;
predecessorCnt++;
successorCnt = predecessor.getSuccessors().size();
mayPreHeader = predecessor;
}
if (predecessorCnt == 1 && successorCnt == 1) {
preHeader = mayPreHeader;
loopAnalysis.preHeaders.add(preHeader);
assert blockNodeMap.containsKey(preHeader) && blockNodeMap.get(preHeader) == this.father;
return true;
} else
return false;
}
public void addPreHeader(Map<BasicBlock, LoopNode> blockNodeMap) {
Function function = header.getFunction();
preHeader = new BasicBlock(function, "preHeaderOf" + header.getNameWithoutDot());
loopAnalysis.preHeaders.add(preHeader);
function.getSymbolTable().put(preHeader.getName(), preHeader);
// Deal with PhiInst.
IRInstruction ptr = header.getInstHead();
while (ptr instanceof PhiInst) {
assert ptr.hasResult();
Register result = ptr.getResult();
Register newResult = new Register(result.getType(), result.getNameWithoutDot());
PhiInst phiInst = new PhiInst(preHeader, new LinkedHashSet<>(), newResult);
function.getSymbolTable().put(newResult.getName(), newResult);
ArrayList<Pair<Operand, BasicBlock>> removeList = new ArrayList<>();
for (Pair<Operand, BasicBlock> branch : ((PhiInst) ptr).getBranch()) {
if (loopBlocks.contains(branch.getSecond()))
continue;
phiInst.addBranch(branch.getFirst(), branch.getSecond());
removeList.add(branch);
}
preHeader.addInstruction(phiInst);
for (Pair<Operand, BasicBlock> pair : removeList)
((PhiInst) ptr).removeIncomingBranch(pair);
((PhiInst) ptr).addBranch(newResult, preHeader);
ptr = ptr.getInstNext();
}
// Deal with predecessor and successor.
ArrayList<BasicBlock> removeList = new ArrayList<>();
for (BasicBlock predecessor : header.getPredecessors()) {
if (loopBlocks.contains(predecessor))
continue;
IRInstruction branchInst = predecessor.getInstTail();
assert branchInst instanceof BranchInst;
branchInst.replaceUse(header, preHeader);
predecessor.getSuccessors().remove(header);
predecessor.getSuccessors().add(preHeader);
preHeader.getPredecessors().add(predecessor);
removeList.add(predecessor);
}
for (BasicBlock block : removeList)
header.getPredecessors().remove(block);
preHeader.addInstruction(new BranchInst(preHeader, null, header, null));
assert header.getPrev() != null;
header.getPrev().setNext(preHeader);
preHeader.setPrev(header.getPrev());
header.setPrev(preHeader);
preHeader.setNext(header);
blockNodeMap.put(preHeader, this.father);
}
public BasicBlock getPreHeader() {
return preHeader;
}
public void mergeLoopNode(LoopNode loop) {
assert this.header == loop.header;
this.loopBlocks.addAll(loop.loopBlocks);
}
public void removeUniqueLoopBlocks(LoopNode child) {
assert uniqueLoopBlocks.containsAll(child.loopBlocks);
uniqueLoopBlocks.removeAll(child.loopBlocks);
}
public boolean defOutOfLoop(Operand operand) {
if (operand instanceof Parameter || operand instanceof Constant || operand instanceof GlobalVariable)
return true;
assert operand instanceof Register;
return !this.loopBlocks.contains(((Register) operand).getDef().getBasicBlock());
}
@Override
public String toString() {
return header.getName();
}
}
private Map<Function, LoopNode> loopRoot;
private Map<BasicBlock, LoopNode> blockNodeMap;
private Map<BasicBlock, LoopNode> headerNodeMap;
private Set<BasicBlock> preHeaders;
public LoopAnalysis(Module module) {
super(module);
LoopNode.loopAnalysis = this;
}
public Map<Function, LoopNode> getLoopRoot() {
return loopRoot;
}
public Map<BasicBlock, LoopNode> getBlockNodeMap() {
return blockNodeMap;
}
public boolean isPreHeader(BasicBlock block) {
return preHeaders != null && preHeaders.contains(block);
}
public int getBlockDepth(MxCompiler.RISCV.BasicBlock ASMBlock) {
BasicBlock irBlock = ASMBlock.getIrBlock();
return blockNodeMap.get(irBlock).getDepth();
}
@Override
public boolean run() {
for (Function function : module.getFunctionMap().values()) {
if (function.isNotFunctional())
return false;
}
loopRoot = new HashMap<>();
blockNodeMap = new HashMap<>();
headerNodeMap = new HashMap<>();
preHeaders = new HashSet<>();
for (Function function : module.getFunctionMap().values())
loopRoot.put(function, constructLoopTree(function));
return false;
}
private LoopNode constructLoopTree(Function function) {
LoopNode root = new LoopNode(function.getEntranceBlock());
loopRoot.put(function, root);
dfsDetectNaturalLoop(function.getEntranceBlock(), new HashSet<>(), root);
dfsConstructLoopTree(function.getEntranceBlock(), new HashSet<>(), root);
root.setDepth(0);
dfsLoopTree(root);
return root;
}
private void dfsDetectNaturalLoop(BasicBlock block, Set<BasicBlock> visit, LoopNode root) {
visit.add(block);
root.addLoopBlock(block);
for (BasicBlock successor : block.getSuccessors()) {
if (successor.dominate(block)) {
// Means that a back edge is found.
extractNaturalLoop(successor, block);
} else if (!visit.contains(successor))
dfsDetectNaturalLoop(successor, visit, root);
}
}
private void extractNaturalLoop(BasicBlock header, BasicBlock end) {
LoopNode loop = new LoopNode(header);
HashSet<BasicBlock> visit = new HashSet<>();
Queue<BasicBlock> queue = new LinkedList<>();
queue.offer(end);
visit.add(end);
while (!queue.isEmpty()) {
BasicBlock block = queue.poll();
if (header.dominate(block))
loop.addLoopBlock(block);
for (BasicBlock predecessor : block.getPredecessors()) {
if (predecessor != header && !visit.contains(predecessor)) {
queue.offer(predecessor);
visit.add(predecessor);
}
}
}
loop.addLoopBlock(header);
if (!headerNodeMap.containsKey(header))
headerNodeMap.put(header, loop);
else
headerNodeMap.get(header).mergeLoopNode(loop);
}
private void dfsConstructLoopTree(BasicBlock block, Set<BasicBlock> visit, LoopNode currentLoop) {
visit.add(block);
LoopNode child = null;
if (block == currentLoop.header) {
// block == entrance block
currentLoop.uniqueLoopBlocks = new HashSet<>(currentLoop.loopBlocks);
} else if (headerNodeMap.containsKey(block)) {
child = headerNodeMap.get(block);
child.setFather(currentLoop);
currentLoop.addChild(child);
currentLoop.removeUniqueLoopBlocks(child);
child.uniqueLoopBlocks = new HashSet<>(child.loopBlocks);
}
for (BasicBlock successor : block.getSuccessors()) {
if (!visit.contains(successor)) {
LoopNode nextLoop = child != null ? child : currentLoop;
while (nextLoop != null && !nextLoop.loopBlocks.contains(successor))
nextLoop = nextLoop.father;
assert nextLoop != null;
dfsConstructLoopTree(successor, visit, nextLoop);
}
}
}
private void dfsLoopTree(LoopNode loop) {
for (BasicBlock block : loop.uniqueLoopBlocks)
blockNodeMap.put(block, loop);
for (LoopNode child : loop.children) {
child.setDepth(loop.getDepth() + 1);
dfsLoopTree(child);
}
if (loop.hasFather() && !loop.hasPreHeader(blockNodeMap))
loop.addPreHeader(blockNodeMap);
Set<BasicBlock> exitBlocks = new HashSet<>();
if (loop.hasFather()) {
for (LoopNode child : loop.children) {
for (BasicBlock exit : child.exitBlocks) {
assert exit.getInstTail() instanceof BranchInst;
BranchInst exitInst = ((BranchInst) exit.getInstTail());
if (!loop.getLoopBlocks().contains(exitInst.getThenBlock())) {
exitBlocks.add(exit);
break;
}
if (exitInst.isConditional() && !loop.getLoopBlocks().contains(exitInst.getElseBlock())) {
exitBlocks.add(exit);
break;
}
}
}
for (BasicBlock exit : loop.getUniqueLoopBlocks()) {
assert exit.getInstTail() instanceof BranchInst;
BranchInst exitInst = ((BranchInst) exit.getInstTail());
if (!loop.getLoopBlocks().contains(exitInst.getThenBlock())) {
exitBlocks.add(exit);
break;
}
if (exitInst.isConditional() && !loop.getLoopBlocks().contains(exitInst.getElseBlock())) {
exitBlocks.add(exit);
break;
}
}
}
loop.setExitBlocks(exitBlocks);
}
}
| UTF-8 | Java | 13,016 | java | LoopAnalysis.java | Java | []
| null | []
| package MxCompiler.Optim.LoopOptim;
import MxCompiler.IR.BasicBlock;
import MxCompiler.IR.Function;
import MxCompiler.IR.Instruction.BranchInst;
import MxCompiler.IR.Instruction.IRInstruction;
import MxCompiler.IR.Instruction.PhiInst;
import MxCompiler.IR.Module;
import MxCompiler.IR.Operand.*;
import MxCompiler.Optim.Pass;
import MxCompiler.Utilities.Pair;
import java.util.*;
public class LoopAnalysis extends Pass {
static public class LoopNode {
static LoopAnalysis loopAnalysis;
private BasicBlock header;
private Set<BasicBlock> loopBlocks;
private Set<BasicBlock> uniqueLoopBlocks;
private Set<BasicBlock> exitBlocks;
private LoopNode father;
private ArrayList<LoopNode> children;
private int depth;
private BasicBlock preHeader;
public LoopNode(BasicBlock header) {
this.header = header;
this.loopBlocks = new HashSet<>();
this.uniqueLoopBlocks = null;
this.exitBlocks = null;
this.father = null;
this.children = new ArrayList<>();
this.depth = 0;
this.preHeader = null;
}
public void addLoopBlock(BasicBlock block) {
this.loopBlocks.add(block);
}
public Set<BasicBlock> getLoopBlocks() {
return loopBlocks;
}
public Set<BasicBlock> getUniqueLoopBlocks() {
return uniqueLoopBlocks;
}
public Set<BasicBlock> getExitBlocks() {
return exitBlocks;
}
public void setExitBlocks(Set<BasicBlock> exitBlocks) {
this.exitBlocks = exitBlocks;
}
public void setFather(LoopNode father) {
this.father = father;
}
public boolean hasFather() {
return father != null;
}
public void addChild(LoopNode child) {
children.add(child);
}
public ArrayList<LoopNode> getChildren() {
return children;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
public boolean hasPreHeader(Map<BasicBlock, LoopNode> blockNodeMap) {
if (preHeader != null)
return true;
/*
* If header has only one predecessor out of block,
* and the only predecessor has only one successor(header),
* then we can mark the only predecessor as preHeader.
*/
int predecessorCnt = 0;
int successorCnt = 0;
BasicBlock mayPreHeader = null;
for (BasicBlock predecessor : header.getPredecessors()) {
if (loopBlocks.contains(predecessor))
continue;
predecessorCnt++;
successorCnt = predecessor.getSuccessors().size();
mayPreHeader = predecessor;
}
if (predecessorCnt == 1 && successorCnt == 1) {
preHeader = mayPreHeader;
loopAnalysis.preHeaders.add(preHeader);
assert blockNodeMap.containsKey(preHeader) && blockNodeMap.get(preHeader) == this.father;
return true;
} else
return false;
}
public void addPreHeader(Map<BasicBlock, LoopNode> blockNodeMap) {
Function function = header.getFunction();
preHeader = new BasicBlock(function, "preHeaderOf" + header.getNameWithoutDot());
loopAnalysis.preHeaders.add(preHeader);
function.getSymbolTable().put(preHeader.getName(), preHeader);
// Deal with PhiInst.
IRInstruction ptr = header.getInstHead();
while (ptr instanceof PhiInst) {
assert ptr.hasResult();
Register result = ptr.getResult();
Register newResult = new Register(result.getType(), result.getNameWithoutDot());
PhiInst phiInst = new PhiInst(preHeader, new LinkedHashSet<>(), newResult);
function.getSymbolTable().put(newResult.getName(), newResult);
ArrayList<Pair<Operand, BasicBlock>> removeList = new ArrayList<>();
for (Pair<Operand, BasicBlock> branch : ((PhiInst) ptr).getBranch()) {
if (loopBlocks.contains(branch.getSecond()))
continue;
phiInst.addBranch(branch.getFirst(), branch.getSecond());
removeList.add(branch);
}
preHeader.addInstruction(phiInst);
for (Pair<Operand, BasicBlock> pair : removeList)
((PhiInst) ptr).removeIncomingBranch(pair);
((PhiInst) ptr).addBranch(newResult, preHeader);
ptr = ptr.getInstNext();
}
// Deal with predecessor and successor.
ArrayList<BasicBlock> removeList = new ArrayList<>();
for (BasicBlock predecessor : header.getPredecessors()) {
if (loopBlocks.contains(predecessor))
continue;
IRInstruction branchInst = predecessor.getInstTail();
assert branchInst instanceof BranchInst;
branchInst.replaceUse(header, preHeader);
predecessor.getSuccessors().remove(header);
predecessor.getSuccessors().add(preHeader);
preHeader.getPredecessors().add(predecessor);
removeList.add(predecessor);
}
for (BasicBlock block : removeList)
header.getPredecessors().remove(block);
preHeader.addInstruction(new BranchInst(preHeader, null, header, null));
assert header.getPrev() != null;
header.getPrev().setNext(preHeader);
preHeader.setPrev(header.getPrev());
header.setPrev(preHeader);
preHeader.setNext(header);
blockNodeMap.put(preHeader, this.father);
}
public BasicBlock getPreHeader() {
return preHeader;
}
public void mergeLoopNode(LoopNode loop) {
assert this.header == loop.header;
this.loopBlocks.addAll(loop.loopBlocks);
}
public void removeUniqueLoopBlocks(LoopNode child) {
assert uniqueLoopBlocks.containsAll(child.loopBlocks);
uniqueLoopBlocks.removeAll(child.loopBlocks);
}
public boolean defOutOfLoop(Operand operand) {
if (operand instanceof Parameter || operand instanceof Constant || operand instanceof GlobalVariable)
return true;
assert operand instanceof Register;
return !this.loopBlocks.contains(((Register) operand).getDef().getBasicBlock());
}
@Override
public String toString() {
return header.getName();
}
}
private Map<Function, LoopNode> loopRoot;
private Map<BasicBlock, LoopNode> blockNodeMap;
private Map<BasicBlock, LoopNode> headerNodeMap;
private Set<BasicBlock> preHeaders;
public LoopAnalysis(Module module) {
super(module);
LoopNode.loopAnalysis = this;
}
public Map<Function, LoopNode> getLoopRoot() {
return loopRoot;
}
public Map<BasicBlock, LoopNode> getBlockNodeMap() {
return blockNodeMap;
}
public boolean isPreHeader(BasicBlock block) {
return preHeaders != null && preHeaders.contains(block);
}
public int getBlockDepth(MxCompiler.RISCV.BasicBlock ASMBlock) {
BasicBlock irBlock = ASMBlock.getIrBlock();
return blockNodeMap.get(irBlock).getDepth();
}
@Override
public boolean run() {
for (Function function : module.getFunctionMap().values()) {
if (function.isNotFunctional())
return false;
}
loopRoot = new HashMap<>();
blockNodeMap = new HashMap<>();
headerNodeMap = new HashMap<>();
preHeaders = new HashSet<>();
for (Function function : module.getFunctionMap().values())
loopRoot.put(function, constructLoopTree(function));
return false;
}
private LoopNode constructLoopTree(Function function) {
LoopNode root = new LoopNode(function.getEntranceBlock());
loopRoot.put(function, root);
dfsDetectNaturalLoop(function.getEntranceBlock(), new HashSet<>(), root);
dfsConstructLoopTree(function.getEntranceBlock(), new HashSet<>(), root);
root.setDepth(0);
dfsLoopTree(root);
return root;
}
private void dfsDetectNaturalLoop(BasicBlock block, Set<BasicBlock> visit, LoopNode root) {
visit.add(block);
root.addLoopBlock(block);
for (BasicBlock successor : block.getSuccessors()) {
if (successor.dominate(block)) {
// Means that a back edge is found.
extractNaturalLoop(successor, block);
} else if (!visit.contains(successor))
dfsDetectNaturalLoop(successor, visit, root);
}
}
private void extractNaturalLoop(BasicBlock header, BasicBlock end) {
LoopNode loop = new LoopNode(header);
HashSet<BasicBlock> visit = new HashSet<>();
Queue<BasicBlock> queue = new LinkedList<>();
queue.offer(end);
visit.add(end);
while (!queue.isEmpty()) {
BasicBlock block = queue.poll();
if (header.dominate(block))
loop.addLoopBlock(block);
for (BasicBlock predecessor : block.getPredecessors()) {
if (predecessor != header && !visit.contains(predecessor)) {
queue.offer(predecessor);
visit.add(predecessor);
}
}
}
loop.addLoopBlock(header);
if (!headerNodeMap.containsKey(header))
headerNodeMap.put(header, loop);
else
headerNodeMap.get(header).mergeLoopNode(loop);
}
private void dfsConstructLoopTree(BasicBlock block, Set<BasicBlock> visit, LoopNode currentLoop) {
visit.add(block);
LoopNode child = null;
if (block == currentLoop.header) {
// block == entrance block
currentLoop.uniqueLoopBlocks = new HashSet<>(currentLoop.loopBlocks);
} else if (headerNodeMap.containsKey(block)) {
child = headerNodeMap.get(block);
child.setFather(currentLoop);
currentLoop.addChild(child);
currentLoop.removeUniqueLoopBlocks(child);
child.uniqueLoopBlocks = new HashSet<>(child.loopBlocks);
}
for (BasicBlock successor : block.getSuccessors()) {
if (!visit.contains(successor)) {
LoopNode nextLoop = child != null ? child : currentLoop;
while (nextLoop != null && !nextLoop.loopBlocks.contains(successor))
nextLoop = nextLoop.father;
assert nextLoop != null;
dfsConstructLoopTree(successor, visit, nextLoop);
}
}
}
private void dfsLoopTree(LoopNode loop) {
for (BasicBlock block : loop.uniqueLoopBlocks)
blockNodeMap.put(block, loop);
for (LoopNode child : loop.children) {
child.setDepth(loop.getDepth() + 1);
dfsLoopTree(child);
}
if (loop.hasFather() && !loop.hasPreHeader(blockNodeMap))
loop.addPreHeader(blockNodeMap);
Set<BasicBlock> exitBlocks = new HashSet<>();
if (loop.hasFather()) {
for (LoopNode child : loop.children) {
for (BasicBlock exit : child.exitBlocks) {
assert exit.getInstTail() instanceof BranchInst;
BranchInst exitInst = ((BranchInst) exit.getInstTail());
if (!loop.getLoopBlocks().contains(exitInst.getThenBlock())) {
exitBlocks.add(exit);
break;
}
if (exitInst.isConditional() && !loop.getLoopBlocks().contains(exitInst.getElseBlock())) {
exitBlocks.add(exit);
break;
}
}
}
for (BasicBlock exit : loop.getUniqueLoopBlocks()) {
assert exit.getInstTail() instanceof BranchInst;
BranchInst exitInst = ((BranchInst) exit.getInstTail());
if (!loop.getLoopBlocks().contains(exitInst.getThenBlock())) {
exitBlocks.add(exit);
break;
}
if (exitInst.isConditional() && !loop.getLoopBlocks().contains(exitInst.getElseBlock())) {
exitBlocks.add(exit);
break;
}
}
}
loop.setExitBlocks(exitBlocks);
}
}
| 13,016 | 0.576291 | 0.575753 | 366 | 34.562843 | 25.880138 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.584699 | false | false | 0 |
236230ff1ac53bf9c0260599a6e569e5ccc9861e | 2,482,491,158,555 | 26e0f36788303c7c4a7673989502663e41ca680f | /src/main/java/com/youdeyiwu/youdeyiwubackend/service/notification/impl/CommentNotificationServiceImpl.java | 3a003572322d901216199d6ea6af047b62e911eb | [
"MIT"
]
| permissive | dafengzhen/youdeyiwu-backend | https://github.com/dafengzhen/youdeyiwu-backend | 54f717e259589c9a4e9d0cf22982c4d5fb753bf6 | faaa80b30f853bee6acadea6e51f88ff23368574 | refs/heads/main | 2023-09-04T12:34:34.955000 | 2023-08-31T08:00:45 | 2023-08-31T08:00:45 | 540,742,551 | 13 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.youdeyiwu.youdeyiwubackend.service.notification.impl;
import static com.youdeyiwu.youdeyiwubackend.constant.HelpConstant.CREATE_NOTICE_FAILURE;
import static com.youdeyiwu.youdeyiwubackend.constant.RabbitmqConstant.NOTICE_NAVIGATION_KEY;
import static com.youdeyiwu.youdeyiwubackend.tool.Tool.now;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.youdeyiwu.youdeyiwubackend.enums.message.MessageRangeEnum;
import com.youdeyiwu.youdeyiwubackend.enums.message.MessageTypeEnum;
import com.youdeyiwu.youdeyiwubackend.exception.CustomException;
import com.youdeyiwu.youdeyiwubackend.model.dto.message.MessageEntityDto;
import com.youdeyiwu.youdeyiwubackend.model.entity.forum.CommentEntity;
import com.youdeyiwu.youdeyiwubackend.model.entity.forum.PostEntity;
import com.youdeyiwu.youdeyiwubackend.model.entity.user.UserEntity;
import com.youdeyiwu.youdeyiwubackend.model.vo.notification.forum.comment.CommentPostCommentNotificationVo;
import com.youdeyiwu.youdeyiwubackend.model.vo.notification.forum.comment.CommentReviewStateNotificationVo;
import com.youdeyiwu.youdeyiwubackend.repository.user.UserRepository;
import com.youdeyiwu.youdeyiwubackend.service.notification.CommentNotificationService;
import com.youdeyiwu.youdeyiwubackend.service.security.SecurityService;
import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
/**
* 评论通知.
*
* @author dafengzhen
*/
@RequiredArgsConstructor
@Service
public class CommentNotificationServiceImpl implements CommentNotificationService {
private final RabbitTemplate rabbitTemplate;
private final SecurityService securityService;
private final UserRepository userRepository;
private final ObjectMapper objectMapper;
@Override
public void postComment(@NotNull CommentEntity entity) {
PostEntity postEntity = entity.getPost();
Set<UserEntity> receiver = new HashSet<>();
receiver.add(userRepository.findById(postEntity.getCreatedBy()));
UserEntity sender = getSender();
CommentPostCommentNotificationVo vo = new CommentPostCommentNotificationVo();
vo.setId(entity.getId());
vo.setName(postEntity.getName());
vo.setSenderId(sender.getId());
vo.setSenderAlias(securityService.getUsername(sender));
vo.setCreatedOn(now());
vo.setPostId(postEntity.getId());
vo.setCommentContent(entity.getContent());
vo.setReviewState(entity.getReviewState());
vo.setKey("create_post_comment");
try {
String content = objectMapper.writeValueAsString(vo);
receiver.forEach(user -> {
String name = MessageFormat.format("""
{0} 于 {1} 对 {2} 进行评论
""", vo.getSenderAlias(), vo.getCreatedOn(), vo.getName());
String overview = MessageFormat.format("""
{0} 新增评论为 {1}
""", vo.getName(), vo.getCommentContent());
MessageEntityDto dto =
new MessageEntityDto(
vo.getSenderId(),
user.getId(),
name,
content,
MessageTypeEnum.COMMENT,
MessageRangeEnum.USER,
vo.getId(),
"createPostComment",
"创建帖子评论",
overview
);
rabbitTemplate.convertAndSend(vo.getId() + "_" + "createPostComment" + NOTICE_NAVIGATION_KEY, dto);
});
} catch (JsonProcessingException e) {
throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR, CREATE_NOTICE_FAILURE);
}
}
@Override
public void reviewState(@NotNull CommentEntity entity) {
if (Objects.isNull(entity.getOldReviewState()) || entity.getOldReviewState() == entity.getReviewState()) {
return;
}
PostEntity postEntity = entity.getPost();
UserEntity sender = getSender();
Set<UserEntity> receiver = getReceiver(entity);
CommentReviewStateNotificationVo vo = new CommentReviewStateNotificationVo();
vo.setId(entity.getId());
vo.setName(postEntity.getName());
vo.setSenderId(sender.getId());
vo.setSenderAlias(securityService.getUsername(sender));
vo.setCreatedOn(now());
vo.setPostId(postEntity.getId());
vo.setCommentContent(entity.getContent());
vo.setReviewState(entity.getReviewState());
vo.setOldReviewState(entity.getOldReviewState());
vo.setKey("update_comment_state");
try {
String content = objectMapper.writeValueAsString(vo);
receiver.forEach(user -> {
String name = MessageFormat.format("""
{0} 于 {1} 更新帖子评论 {2} 状态
""", vo.getSenderAlias(), vo.getCreatedOn(), vo.getName());
String overview = MessageFormat.format("""
{0} 帖子评论状态从 {1} 变更为 {2}
""", vo.getName(), vo.getOldReviewState().getValue(), vo.getReviewState().getValue());
MessageEntityDto dto =
new MessageEntityDto(
vo.getSenderId(),
user.getId(),
name,
content,
MessageTypeEnum.COMMENT,
MessageRangeEnum.USER,
vo.getId(),
"updateCommentState",
"更新评论状态",
overview
);
rabbitTemplate.convertAndSend(vo.getId() + "_" + "updateCommentState" + NOTICE_NAVIGATION_KEY, dto);
});
} catch (JsonProcessingException e) {
throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR, CREATE_NOTICE_FAILURE);
}
}
/**
* 获取发送者.
*
* @return UserEntity
*/
private UserEntity getSender() {
return securityService.getAuthenticatedUser();
}
/**
* 获取接收者.
*
* @param entity entity
* @return Set
*/
private @NotNull Set<UserEntity> getReceiver(@NotNull CommentEntity entity) {
Set<UserEntity> list = new HashSet<>();
list.add(userRepository.findById(entity.getCreatedBy()));
return list;
}
} | UTF-8 | Java | 6,856 | java | CommentNotificationServiceImpl.java | Java | [
{
"context": "rk.stereotype.Service;\n\n/**\n * 评论通知.\n *\n * @author dafengzhen\n */\n@RequiredArgsConstructor\n@Service\npublic clas",
"end": 1731,
"score": 0.9994102716445923,
"start": 1721,
"tag": "USERNAME",
"value": "dafengzhen"
},
{
"context": "ty.getOldReviewState());\n vo.setKey(\"update_comment_state\");\n\n try {\n String",
"end": 4961,
"score": 0.5684959292411804,
"start": 4961,
"tag": "KEY",
"value": ""
},
{
"context": "dReviewState());\n vo.setKey(\"update_comment_state\");\n\n try {\n String content = ob",
"end": 4975,
"score": 0.5530391931533813,
"start": 4970,
"tag": "KEY",
"value": "state"
}
]
| null | []
| package com.youdeyiwu.youdeyiwubackend.service.notification.impl;
import static com.youdeyiwu.youdeyiwubackend.constant.HelpConstant.CREATE_NOTICE_FAILURE;
import static com.youdeyiwu.youdeyiwubackend.constant.RabbitmqConstant.NOTICE_NAVIGATION_KEY;
import static com.youdeyiwu.youdeyiwubackend.tool.Tool.now;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.youdeyiwu.youdeyiwubackend.enums.message.MessageRangeEnum;
import com.youdeyiwu.youdeyiwubackend.enums.message.MessageTypeEnum;
import com.youdeyiwu.youdeyiwubackend.exception.CustomException;
import com.youdeyiwu.youdeyiwubackend.model.dto.message.MessageEntityDto;
import com.youdeyiwu.youdeyiwubackend.model.entity.forum.CommentEntity;
import com.youdeyiwu.youdeyiwubackend.model.entity.forum.PostEntity;
import com.youdeyiwu.youdeyiwubackend.model.entity.user.UserEntity;
import com.youdeyiwu.youdeyiwubackend.model.vo.notification.forum.comment.CommentPostCommentNotificationVo;
import com.youdeyiwu.youdeyiwubackend.model.vo.notification.forum.comment.CommentReviewStateNotificationVo;
import com.youdeyiwu.youdeyiwubackend.repository.user.UserRepository;
import com.youdeyiwu.youdeyiwubackend.service.notification.CommentNotificationService;
import com.youdeyiwu.youdeyiwubackend.service.security.SecurityService;
import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
/**
* 评论通知.
*
* @author dafengzhen
*/
@RequiredArgsConstructor
@Service
public class CommentNotificationServiceImpl implements CommentNotificationService {
private final RabbitTemplate rabbitTemplate;
private final SecurityService securityService;
private final UserRepository userRepository;
private final ObjectMapper objectMapper;
@Override
public void postComment(@NotNull CommentEntity entity) {
PostEntity postEntity = entity.getPost();
Set<UserEntity> receiver = new HashSet<>();
receiver.add(userRepository.findById(postEntity.getCreatedBy()));
UserEntity sender = getSender();
CommentPostCommentNotificationVo vo = new CommentPostCommentNotificationVo();
vo.setId(entity.getId());
vo.setName(postEntity.getName());
vo.setSenderId(sender.getId());
vo.setSenderAlias(securityService.getUsername(sender));
vo.setCreatedOn(now());
vo.setPostId(postEntity.getId());
vo.setCommentContent(entity.getContent());
vo.setReviewState(entity.getReviewState());
vo.setKey("create_post_comment");
try {
String content = objectMapper.writeValueAsString(vo);
receiver.forEach(user -> {
String name = MessageFormat.format("""
{0} 于 {1} 对 {2} 进行评论
""", vo.getSenderAlias(), vo.getCreatedOn(), vo.getName());
String overview = MessageFormat.format("""
{0} 新增评论为 {1}
""", vo.getName(), vo.getCommentContent());
MessageEntityDto dto =
new MessageEntityDto(
vo.getSenderId(),
user.getId(),
name,
content,
MessageTypeEnum.COMMENT,
MessageRangeEnum.USER,
vo.getId(),
"createPostComment",
"创建帖子评论",
overview
);
rabbitTemplate.convertAndSend(vo.getId() + "_" + "createPostComment" + NOTICE_NAVIGATION_KEY, dto);
});
} catch (JsonProcessingException e) {
throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR, CREATE_NOTICE_FAILURE);
}
}
@Override
public void reviewState(@NotNull CommentEntity entity) {
if (Objects.isNull(entity.getOldReviewState()) || entity.getOldReviewState() == entity.getReviewState()) {
return;
}
PostEntity postEntity = entity.getPost();
UserEntity sender = getSender();
Set<UserEntity> receiver = getReceiver(entity);
CommentReviewStateNotificationVo vo = new CommentReviewStateNotificationVo();
vo.setId(entity.getId());
vo.setName(postEntity.getName());
vo.setSenderId(sender.getId());
vo.setSenderAlias(securityService.getUsername(sender));
vo.setCreatedOn(now());
vo.setPostId(postEntity.getId());
vo.setCommentContent(entity.getContent());
vo.setReviewState(entity.getReviewState());
vo.setOldReviewState(entity.getOldReviewState());
vo.setKey("update_comment_state");
try {
String content = objectMapper.writeValueAsString(vo);
receiver.forEach(user -> {
String name = MessageFormat.format("""
{0} 于 {1} 更新帖子评论 {2} 状态
""", vo.getSenderAlias(), vo.getCreatedOn(), vo.getName());
String overview = MessageFormat.format("""
{0} 帖子评论状态从 {1} 变更为 {2}
""", vo.getName(), vo.getOldReviewState().getValue(), vo.getReviewState().getValue());
MessageEntityDto dto =
new MessageEntityDto(
vo.getSenderId(),
user.getId(),
name,
content,
MessageTypeEnum.COMMENT,
MessageRangeEnum.USER,
vo.getId(),
"updateCommentState",
"更新评论状态",
overview
);
rabbitTemplate.convertAndSend(vo.getId() + "_" + "updateCommentState" + NOTICE_NAVIGATION_KEY, dto);
});
} catch (JsonProcessingException e) {
throw new CustomException(HttpStatus.INTERNAL_SERVER_ERROR, CREATE_NOTICE_FAILURE);
}
}
/**
* 获取发送者.
*
* @return UserEntity
*/
private UserEntity getSender() {
return securityService.getAuthenticatedUser();
}
/**
* 获取接收者.
*
* @param entity entity
* @return Set
*/
private @NotNull Set<UserEntity> getReceiver(@NotNull CommentEntity entity) {
Set<UserEntity> list = new HashSet<>();
list.add(userRepository.findById(entity.getCreatedBy()));
return list;
}
} | 6,856 | 0.634638 | 0.633007 | 168 | 39.148811 | 28.183632 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.672619 | false | false | 0 |
b49d08b6601903341ecc5c34974c87f3683a4a21 | 5,686,536,723,167 | 93e61b462bd1e9b37468fefb04fbf89aca22c1c2 | /src/main/java/pl/noga/PortalOskApp/dao/entity/Course.java | 6ec2b90078d2030458ece65af2198153b1ebc516 | []
| no_license | kfnoga/portalosk-app | https://github.com/kfnoga/portalosk-app | b0709bce87b7239564dc220b01f4e9363856f0f4 | 671014fcd90b9239b65fcc727575dfdc3e4cb2f6 | refs/heads/master | 2020-12-07T07:43:41.145000 | 2020-01-17T09:05:29 | 2020-01-17T09:05:29 | 232,674,839 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pl.noga.PortalOskApp.dao.entity;
import pl.noga.PortalOskApp.dao.helper.CourseType;
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "courses")
public class Course {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
private Long id;
private CourseType type;
private double price;
private double discount;
private double payment;
@ManyToMany(mappedBy = "courses")
private List<User> users;
public Course() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CourseType getType() {
return type;
}
public void setType(CourseType type) {
this.type = type;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double getDiscount() {
return discount;
}
public void setDiscount(double discount) {
this.discount = discount;
}
public double getPayment() {
return payment;
}
public void setPayment(double payment) {
this.payment = payment;
}
public Course(Long id, CourseType type, double price, double discount, double payment) {
this.id = id;
this.type = type;
this.price = price;
this.discount = discount;
this.payment = payment;
}
}
| UTF-8 | Java | 1,435 | java | Course.java | Java | []
| null | []
| package pl.noga.PortalOskApp.dao.entity;
import pl.noga.PortalOskApp.dao.helper.CourseType;
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "courses")
public class Course {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
private Long id;
private CourseType type;
private double price;
private double discount;
private double payment;
@ManyToMany(mappedBy = "courses")
private List<User> users;
public Course() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CourseType getType() {
return type;
}
public void setType(CourseType type) {
this.type = type;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double getDiscount() {
return discount;
}
public void setDiscount(double discount) {
this.discount = discount;
}
public double getPayment() {
return payment;
}
public void setPayment(double payment) {
this.payment = payment;
}
public Course(Long id, CourseType type, double price, double discount, double payment) {
this.id = id;
this.type = type;
this.price = price;
this.discount = discount;
this.payment = payment;
}
}
| 1,435 | 0.609059 | 0.609059 | 77 | 17.636364 | 17.420624 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.376623 | false | false | 0 |
b867ccab2c7393d28353fbe5a9c90ba4802b67e2 | 5,686,536,723,245 | 926386167b44865e72a70002a5557d9a79c87c6b | /src/main/java/net/henryco/blinckserver/util/Utils.java | 754d9a64b56a7589fab0ae03aca242278eb54847 | [
"BSD-3-Clause"
]
| permissive | AustineGwa/Blinck-Server | https://github.com/AustineGwa/Blinck-Server | 39d201c867015b6525b36c60f6a9a3d515625485 | 34e0b4cc0ce36cf41b5c9fda1b65a0a05d47cc71 | refs/heads/master | 2021-09-27T18:04:53.202000 | 2018-11-10T12:29:34 | 2018-11-10T12:29:34 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.henryco.blinckserver.util;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
/**
* @author Henry on 17/06/17.
*/
public abstract class Utils {
public static String arrayToString(String[] array) {
return Arrays.toString(array);
}
public static String[] stringToArray(String string) {
if (string == null) return null;
return string.substring(1, string.length() - 1).split(", ");
}
/**
* @return name of saved file or Null
*/
public static String saveMultiPartFileWithOldName(MultipartFile file, String upload_path) {
try {
if (file.isEmpty()) return null;
Files.write(Paths.get(upload_path + file.getOriginalFilename()), file.getBytes());
return file.getOriginalFilename();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* @return New name of saved file or Null
*/
public static String saveMultiPartFileWithNewName(MultipartFile file, String userName, String upload_path) {
try {
if (file.isEmpty()) return null;
final String fileName = file.getOriginalFilename();
final int i = fileName.lastIndexOf(".");
final String userHash = Integer.toString(Math.abs(userName.hashCode()));
final String time = Long.toString(System.nanoTime());
final String fileHash = Integer.toString(Math.abs(fileName.hashCode()));
final String name = userHash + fileHash + time + ( i != -1 ? file.getOriginalFilename().substring(i) : "");
Files.write(Paths.get(upload_path + name), file.getBytes());
return name;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static String saveImageFile(byte[] file, String userName, String upload_path) {
try {
if (file == null || file.length == 0) return null;
String[] typo = URLConnection.guessContentTypeFromStream(new ByteArrayInputStream(file)).split("/");
String type = typo[typo.length - 1];
final String userHash = Integer.toString(Math.abs(userName.hashCode()));
final String time = Long.toString(System.nanoTime());
final String name = Math.abs(Arrays.hashCode(file)) + userHash + time + "."+type;
File upFile = new File(upload_path);
if (!upFile.exists())
if (!upFile.mkdirs())
return null;
Files.write(Paths.get(upload_path + name), file);
return name;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
| UTF-8 | Java | 2,526 | java | Utils.java | Java | [
{
"context": "e.Paths;\nimport java.util.Arrays;\n\n\n/**\n * @author Henry on 17/06/17.\n */\npublic abstract class Utils {\n\n\t",
"end": 289,
"score": 0.9996214509010315,
"start": 284,
"tag": "NAME",
"value": "Henry"
},
{
"context": "ic static String saveImageFile(byte[] file, String userName, String upload_path) {\n\n\t\ttry {\n\t\t\tif (file == nu",
"end": 1817,
"score": 0.978062093257904,
"start": 1809,
"tag": "USERNAME",
"value": "userName"
}
]
| null | []
| package net.henryco.blinckserver.util;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
/**
* @author Henry on 17/06/17.
*/
public abstract class Utils {
public static String arrayToString(String[] array) {
return Arrays.toString(array);
}
public static String[] stringToArray(String string) {
if (string == null) return null;
return string.substring(1, string.length() - 1).split(", ");
}
/**
* @return name of saved file or Null
*/
public static String saveMultiPartFileWithOldName(MultipartFile file, String upload_path) {
try {
if (file.isEmpty()) return null;
Files.write(Paths.get(upload_path + file.getOriginalFilename()), file.getBytes());
return file.getOriginalFilename();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* @return New name of saved file or Null
*/
public static String saveMultiPartFileWithNewName(MultipartFile file, String userName, String upload_path) {
try {
if (file.isEmpty()) return null;
final String fileName = file.getOriginalFilename();
final int i = fileName.lastIndexOf(".");
final String userHash = Integer.toString(Math.abs(userName.hashCode()));
final String time = Long.toString(System.nanoTime());
final String fileHash = Integer.toString(Math.abs(fileName.hashCode()));
final String name = userHash + fileHash + time + ( i != -1 ? file.getOriginalFilename().substring(i) : "");
Files.write(Paths.get(upload_path + name), file.getBytes());
return name;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static String saveImageFile(byte[] file, String userName, String upload_path) {
try {
if (file == null || file.length == 0) return null;
String[] typo = URLConnection.guessContentTypeFromStream(new ByteArrayInputStream(file)).split("/");
String type = typo[typo.length - 1];
final String userHash = Integer.toString(Math.abs(userName.hashCode()));
final String time = Long.toString(System.nanoTime());
final String name = Math.abs(Arrays.hashCode(file)) + userHash + time + "."+type;
File upFile = new File(upload_path);
if (!upFile.exists())
if (!upFile.mkdirs())
return null;
Files.write(Paths.get(upload_path + name), file);
return name;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
| 2,526 | 0.694378 | 0.690024 | 91 | 26.758242 | 28.917215 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.021978 | false | false | 0 |
12342ce333d3ab594eb05d20698b44242a5b6816 | 21,784,074,140,338 | a02ca44e604afa610a05cfc3e5cb14266721b3f6 | /Hyouman/src/org/hyouman/model/UserModel.java | 0dd38916cfea8a6eb306e3e760218f91bf3a8d8c | []
| no_license | mbvivek/Hyouman-Web-Application | https://github.com/mbvivek/Hyouman-Web-Application | 44bca423f0dd43714358781f4f13aa57e904f10e | 1a8a74ec475c50923b30d66451db29301cba0297 | refs/heads/master | 2021-05-13T13:58:20.564000 | 2018-01-08T20:29:38 | 2018-01-08T20:29:38 | 116,723,690 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.hyouman.model;
public class UserModel
{
private String email;
private String password;
private String firstName;
private String lastName;
private String phone;
private String dob;
private String gender;
private String street;
private String city;
private String state;
private String country;
private String zip;
private byte[] picture;
private boolean admin;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public byte[] getPicture() {
return picture;
}
public void setPicture(byte[] picture) {
this.picture = picture;
}
public boolean getAdmin() {
return admin;
}
public void setAdmin(boolean admin) {
this.admin = admin;
}
}
| UTF-8 | Java | 2,002 | java | UserModel.java | Java | []
| null | []
| package org.hyouman.model;
public class UserModel
{
private String email;
private String password;
private String firstName;
private String lastName;
private String phone;
private String dob;
private String gender;
private String street;
private String city;
private String state;
private String country;
private String zip;
private byte[] picture;
private boolean admin;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public byte[] getPicture() {
return picture;
}
public void setPicture(byte[] picture) {
this.picture = picture;
}
public boolean getAdmin() {
return admin;
}
public void setAdmin(boolean admin) {
this.admin = admin;
}
}
| 2,002 | 0.701299 | 0.701299 | 105 | 18.066668 | 12.813138 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.628571 | false | false | 0 |
a0ccc470fde756febf4ea2d24f881d13f9cd3df1 | 25,718,264,181,401 | f3148b2d3234cc55faa708b0f545b27f25bf7109 | /src/Caso13.java | 1e3e75dea4a8db4a2d405d76b83f10665eed57bd | []
| no_license | JoanCplusplus/GU-A-PR-CTICA-1 | https://github.com/JoanCplusplus/GU-A-PR-CTICA-1 | 4b58593c839941be6526fcfb94367650007f6274 | 190335db8da147b4e9567bc5e05fb8a933c0aee0 | refs/heads/master | 2022-06-01T00:16:20.246000 | 2020-04-30T18:41:34 | 2020-04-30T18:41:34 | 260,287,392 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.Scanner;
public class Caso13
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Ingrese nombre: ");
String n = sc.nextLine();
System.out.print("Ingrese apellido: ");
String a = sc.nextLine();
System.out.println("------------------------");
System.out.println("RESULTADOS");
System.out.println("------------------------");
System.out.println("Alumno: " + n.concat(" " + a));
}
}
| UTF-8 | Java | 499 | java | Caso13.java | Java | []
| null | []
|
import java.util.Scanner;
public class Caso13
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Ingrese nombre: ");
String n = sc.nextLine();
System.out.print("Ingrese apellido: ");
String a = sc.nextLine();
System.out.println("------------------------");
System.out.println("RESULTADOS");
System.out.println("------------------------");
System.out.println("Alumno: " + n.concat(" " + a));
}
}
| 499 | 0.547094 | 0.543086 | 21 | 21.666666 | 19.042143 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.857143 | false | false | 0 |
f4f03d896e0cd794962deb1cbcec669261b7163f | 32,040,456,037,772 | fc1cbe7f23a59975bf943487e6369d9ad1709e16 | /src/pl/sda/dzien011/Zad3/Main.java | 3e8a864bbb703a2527dc45b0c09d7f251377d407 | []
| no_license | piotrhor11/SDA-JavaWprowadzenie | https://github.com/piotrhor11/SDA-JavaWprowadzenie | 8de0219e0cec36b99e7eaed4850639163d50d8c2 | 147bb24661b6a7ba0dedb14c01d90c1f4d1468ec | refs/heads/master | 2021-01-01T18:16:24.664000 | 2017-09-14T15:08:10 | 2017-09-14T15:08:10 | 98,292,160 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pl.sda.dzien011.Zad3;
public class Main {
public static void main(String[] args) {
GuitarFactory fender = new GuitarFactory("Fender");
GuitarFactory gibson = new GuitarFactory("Gibson");
fender.makeGuitar("Stratocaster", 8000);
gibson.makeGuitar("Les Paul", 6000);
fender.makeGuitar("Telecaster", 2000);
gibson.makeGuitar("Firebird", 1800);
for (Guitar guitar : fender.guitarList) {
System.out.println(guitar.getModel() + guitar.getSerialNumber());
guitar.play();
}
System.out.println();
for (Guitar guitar : gibson.guitarList) {
System.out.println(guitar.getModel() + guitar.getSerialNumber());
}
gibson.testGuitars();
}
}
| UTF-8 | Java | 777 | java | Main.java | Java | [
{
"context": " GuitarFactory gibson = new GuitarFactory(\"Gibson\");\n\n fender.makeGuitar(\"Stratocaster\", 800",
"end": 213,
"score": 0.9318352341651917,
"start": 207,
"tag": "NAME",
"value": "Gibson"
},
{
"context": "\"Stratocaster\", 8000);\n gibson.makeGuitar(\"Les Paul\", 6000);\n fender.makeGuitar(\"Telecaster\", ",
"end": 302,
"score": 0.875468373298645,
"start": 294,
"tag": "NAME",
"value": "Les Paul"
}
]
| null | []
| package pl.sda.dzien011.Zad3;
public class Main {
public static void main(String[] args) {
GuitarFactory fender = new GuitarFactory("Fender");
GuitarFactory gibson = new GuitarFactory("Gibson");
fender.makeGuitar("Stratocaster", 8000);
gibson.makeGuitar("<NAME>", 6000);
fender.makeGuitar("Telecaster", 2000);
gibson.makeGuitar("Firebird", 1800);
for (Guitar guitar : fender.guitarList) {
System.out.println(guitar.getModel() + guitar.getSerialNumber());
guitar.play();
}
System.out.println();
for (Guitar guitar : gibson.guitarList) {
System.out.println(guitar.getModel() + guitar.getSerialNumber());
}
gibson.testGuitars();
}
}
| 775 | 0.611326 | 0.585586 | 25 | 30.08 | 24.476797 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.64 | false | false | 0 |
8d360f5cdc13077b41e0227decb94d10dd91d9ba | 3,985,729,662,591 | a47fe3daf2839bcb516fcffc90b6cac14413fd34 | /Expence/service/src/main/java/com/sid/expence/serviceimpl/UsersServiceImpl.java | e0faee59c0d7ae9fe00f8d8898238c23a5af7637 | []
| no_license | siddharth223437/Ecommerce | https://github.com/siddharth223437/Ecommerce | 1d35134a83c25f5663df5f3e6503911bd3f90303 | 958ff162ee3c588864531bbd1508c7269e954171 | refs/heads/master | 2020-11-29T22:19:29.464000 | 2017-07-08T07:10:49 | 2017-07-08T07:10:49 | 96,601,303 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.sid.expence.serviceimpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sid.expence.common.vo.Users;
import com.sid.expence.dao.UserDao;
import com.sid.expence.service.UsersSerives;
@Service
public class UsersServiceImpl implements UsersSerives {
@Autowired
private UserDao userDao;
@Override
public Users checkLogin(String username, String password) {
// TODO Auto-generated method stub
return userDao.checkLogin(username, password);
}
}
| UTF-8 | Java | 541 | java | UsersServiceImpl.java | Java | []
| null | []
| package com.sid.expence.serviceimpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sid.expence.common.vo.Users;
import com.sid.expence.dao.UserDao;
import com.sid.expence.service.UsersSerives;
@Service
public class UsersServiceImpl implements UsersSerives {
@Autowired
private UserDao userDao;
@Override
public Users checkLogin(String username, String password) {
// TODO Auto-generated method stub
return userDao.checkLogin(username, password);
}
}
| 541 | 0.804067 | 0.804067 | 22 | 23.59091 | 22.192667 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.909091 | false | false | 0 |
97a9a3fd5066180bfec0661fd271d248d6cfbc50 | 29,497,835,424,657 | d04752fdd2491b9c07fd42c4afbf279b5efc8c8b | /src/test/java/nl/rabobank/customerstatementprocessor/controllers/StatementProcessorControllerTest.java | 700348f3e515a92fef3ae7d1a1967ca1e32784e1 | []
| no_license | AjayAnand86/customer-statement-processor | https://github.com/AjayAnand86/customer-statement-processor | 539c6e6b0ef3e61166f1072e6dd0840cb9ca4b3c | e7d867876bae87657cca8503b3930960cfe6cd66 | refs/heads/master | 2021-06-19T13:16:19.585000 | 2019-08-21T22:10:11 | 2019-08-21T22:10:11 | 202,718,761 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package nl.rabobank.customerstatementprocessor.controllers;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.multipart.MultipartFile;
import nl.rabobank.customerstatementprocessor.config.TestConfiguration;
import nl.rabobank.customerstatementprocessor.services.ParserService;
import nl.rabobank.customerstatementprocessor.services.ValidationService;
import nl.rabobank.customerstatementprocessor.validators.ValidationResult;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestConfiguration.class})
public class StatementProcessorControllerTest {
private StatementProcessorController statementProcessorController;
@Autowired
@Qualifier("testParserService")
private ParserService parserService;
@Autowired
@Qualifier("testValidationService")
private ValidationService validationService;
@Before
public void setUp() {
this.statementProcessorController = new StatementProcessorController(parserService,validationService);
}
@Test
public void shouldProcessXMLFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_valid.xml",
"records_valid.xml", "application/xml",new FileInputStream(new File("src/test/resources/data/records_valid.xml")));
ResponseEntity<ValidationResult> response = statementProcessorController.validateStatementFile(multipartFile);
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.OK.value(), response.getStatusCode().value());
}
@Test
public void shouldProcessCSVFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_valid.csv",
"records_valid.csv", "text/csv",
new FileInputStream(new File("src/test/resources/data/records_valid.csv")));
ResponseEntity<ValidationResult> response = statementProcessorController.validateStatementFile(multipartFile);
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.OK.value(), response.getStatusCode().value());
}
@Test(expected = FileNotFoundException.class)
public void shouldProcessWrongFormatFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records.txt",
"records.txt", "text",
new FileInputStream(new File("src/test/resources/data/records.txt")));
ResponseEntity<ValidationResult> response = statementProcessorController.validateStatementFile(multipartFile);
}
@Test(expected = IllegalArgumentException.class)
public void shouldProcessEmptyCSVFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_empty.csv",
"records_empty.csv", "text/csv",new FileInputStream(new File("src/test/resources/data/records_empty.csv")));
statementProcessorController.validateStatementFile(multipartFile);
}
@Test(expected = IllegalArgumentException.class)
public void shouldProcessEmptyXMLFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_empty.xml",
"records_empty.xml", "application/xml",new FileInputStream(new File("src/test/resources/data/records_empty.xml")));
statementProcessorController.validateStatementFile(multipartFile);
}
}
| UTF-8 | Java | 3,838 | java | StatementProcessorControllerTest.java | Java | []
| null | []
| package nl.rabobank.customerstatementprocessor.controllers;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.multipart.MultipartFile;
import nl.rabobank.customerstatementprocessor.config.TestConfiguration;
import nl.rabobank.customerstatementprocessor.services.ParserService;
import nl.rabobank.customerstatementprocessor.services.ValidationService;
import nl.rabobank.customerstatementprocessor.validators.ValidationResult;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestConfiguration.class})
public class StatementProcessorControllerTest {
private StatementProcessorController statementProcessorController;
@Autowired
@Qualifier("testParserService")
private ParserService parserService;
@Autowired
@Qualifier("testValidationService")
private ValidationService validationService;
@Before
public void setUp() {
this.statementProcessorController = new StatementProcessorController(parserService,validationService);
}
@Test
public void shouldProcessXMLFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_valid.xml",
"records_valid.xml", "application/xml",new FileInputStream(new File("src/test/resources/data/records_valid.xml")));
ResponseEntity<ValidationResult> response = statementProcessorController.validateStatementFile(multipartFile);
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.OK.value(), response.getStatusCode().value());
}
@Test
public void shouldProcessCSVFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_valid.csv",
"records_valid.csv", "text/csv",
new FileInputStream(new File("src/test/resources/data/records_valid.csv")));
ResponseEntity<ValidationResult> response = statementProcessorController.validateStatementFile(multipartFile);
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.OK.value(), response.getStatusCode().value());
}
@Test(expected = FileNotFoundException.class)
public void shouldProcessWrongFormatFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records.txt",
"records.txt", "text",
new FileInputStream(new File("src/test/resources/data/records.txt")));
ResponseEntity<ValidationResult> response = statementProcessorController.validateStatementFile(multipartFile);
}
@Test(expected = IllegalArgumentException.class)
public void shouldProcessEmptyCSVFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_empty.csv",
"records_empty.csv", "text/csv",new FileInputStream(new File("src/test/resources/data/records_empty.csv")));
statementProcessorController.validateStatementFile(multipartFile);
}
@Test(expected = IllegalArgumentException.class)
public void shouldProcessEmptyXMLFile() throws Exception {
MultipartFile multipartFile = new MockMultipartFile("records_empty.xml",
"records_empty.xml", "application/xml",new FileInputStream(new File("src/test/resources/data/records_empty.xml")));
statementProcessorController.validateStatementFile(multipartFile);
}
}
| 3,838 | 0.786347 | 0.785565 | 97 | 38.567009 | 36.037754 | 129 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.57732 | false | false | 0 |
6d2011780f35d6be237f4cf6bbefde5a03f816b1 | 13,065,290,555,393 | 279fa6f89bc0143298f9678d98fa3b125bf9b70c | /src/main/java/org/rm3l/beam/WordCount.java | 529e5308a68fb6a2592ad8d10fadd7f382be608a | []
| no_license | rm3l/apache-beam-java-firestore-batch-dataflow | https://github.com/rm3l/apache-beam-java-firestore-batch-dataflow | 29103b00a18ff6b1642e37dba64cdf2e2c9bd04e | 90595bae5bdd91e7cb3a522f2be8bf9d7b964885 | refs/heads/main | 2023-06-01T12:04:10.684000 | 2021-06-13T14:01:41 | 2021-06-13T14:01:41 | 365,048,790 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rm3l.beam;
import org.apache.beam.sdk.metrics.Counter;
import org.apache.beam.sdk.metrics.Distribution;
import org.apache.beam.sdk.metrics.Metrics;
import org.apache.beam.sdk.transforms.Count;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.SimpleFunction;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
/**
* An example that counts words in Shakespeare and includes Beam best practices.
*
* <p>The input file defaults to a public data set containing the text of of King Lear, by William
* Shakespeare. You can override it and choose your own input with {@code --inputFile}.
*/
public class WordCount {
/**
* \p{L} denotes the category of Unicode letters, so this pattern will match on everything that is
* not a letter.
*
* <p>It is used for tokenizing strings in the wordcount examples.
*/
public static final String TOKENIZER_PATTERN = "[^\\p{L}]+";
/**
* Concept #2: You can make your pipeline assembly code less verbose by defining your DoFns
* statically out-of-line. This DoFn tokenizes lines of text into individual words; we pass it to
* a ParDo in the pipeline.
*/
static class ExtractWordsFn extends DoFn<String, String> {
private final Counter emptyLines = Metrics.counter(ExtractWordsFn.class, "emptyLines");
private final Distribution lineLenDist =
Metrics.distribution(ExtractWordsFn.class, "lineLenDistro");
@ProcessElement
public void processElement(@Element String element, OutputReceiver<String> receiver) {
lineLenDist.update(element.length());
if (element.trim().isEmpty()) {
emptyLines.inc();
}
// Split the line into words.
String[] words = element.split(TOKENIZER_PATTERN, -1);
// Output each word encountered into the output PCollection.
for (String word : words) {
if (!word.isEmpty()) {
receiver.output(word);
}
}
}
}
/**
* A SimpleFunction that converts a Word and Count into a printable string.
*/
public static class FormatAsTextFn extends SimpleFunction<KV<String, Long>, String> {
@Override
public String apply(KV<String, Long> input) {
return input.getKey() + ": " + input.getValue();
}
}
/**
* A PTransform that converts a PCollection containing lines of text into a PCollection of
* formatted word counts.
*
* <p>Concept #3: This is a custom composite transform that bundles two transforms (ParDo and
* Count) as a reusable PTransform subclass. Using composite transforms allows for easy reuse,
* modular testing, and an improved monitoring experience.
*/
public static class CountWords
extends PTransform<PCollection<String>, PCollection<KV<String, Long>>> {
@Override
public PCollection<KV<String, Long>> expand(PCollection<String> lines) {
// Convert lines of text into individual words.
PCollection<String> words = lines.apply(ParDo.of(new ExtractWordsFn()));
// Count the number of times each word occurs.
PCollection<KV<String, Long>> wordCounts = words.apply(Count.perElement());
return wordCounts;
}
}
}
| UTF-8 | Java | 4,106 | java | WordCount.java | Java | [
{
"context": "c data set containing the text of of King Lear, by William\n * Shakespeare. You can override it and choose yo",
"end": 1477,
"score": 0.9997479915618896,
"start": 1470,
"tag": "NAME",
"value": "William"
},
{
"context": "containing the text of of King Lear, by William\n * Shakespeare. You can override it and choose your own input wi",
"end": 1492,
"score": 0.9998010396957397,
"start": 1481,
"tag": "NAME",
"value": "Shakespeare"
}
]
| null | []
| /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rm3l.beam;
import org.apache.beam.sdk.metrics.Counter;
import org.apache.beam.sdk.metrics.Distribution;
import org.apache.beam.sdk.metrics.Metrics;
import org.apache.beam.sdk.transforms.Count;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.SimpleFunction;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
/**
* An example that counts words in Shakespeare and includes Beam best practices.
*
* <p>The input file defaults to a public data set containing the text of of King Lear, by William
* Shakespeare. You can override it and choose your own input with {@code --inputFile}.
*/
public class WordCount {
/**
* \p{L} denotes the category of Unicode letters, so this pattern will match on everything that is
* not a letter.
*
* <p>It is used for tokenizing strings in the wordcount examples.
*/
public static final String TOKENIZER_PATTERN = "[^\\p{L}]+";
/**
* Concept #2: You can make your pipeline assembly code less verbose by defining your DoFns
* statically out-of-line. This DoFn tokenizes lines of text into individual words; we pass it to
* a ParDo in the pipeline.
*/
static class ExtractWordsFn extends DoFn<String, String> {
private final Counter emptyLines = Metrics.counter(ExtractWordsFn.class, "emptyLines");
private final Distribution lineLenDist =
Metrics.distribution(ExtractWordsFn.class, "lineLenDistro");
@ProcessElement
public void processElement(@Element String element, OutputReceiver<String> receiver) {
lineLenDist.update(element.length());
if (element.trim().isEmpty()) {
emptyLines.inc();
}
// Split the line into words.
String[] words = element.split(TOKENIZER_PATTERN, -1);
// Output each word encountered into the output PCollection.
for (String word : words) {
if (!word.isEmpty()) {
receiver.output(word);
}
}
}
}
/**
* A SimpleFunction that converts a Word and Count into a printable string.
*/
public static class FormatAsTextFn extends SimpleFunction<KV<String, Long>, String> {
@Override
public String apply(KV<String, Long> input) {
return input.getKey() + ": " + input.getValue();
}
}
/**
* A PTransform that converts a PCollection containing lines of text into a PCollection of
* formatted word counts.
*
* <p>Concept #3: This is a custom composite transform that bundles two transforms (ParDo and
* Count) as a reusable PTransform subclass. Using composite transforms allows for easy reuse,
* modular testing, and an improved monitoring experience.
*/
public static class CountWords
extends PTransform<PCollection<String>, PCollection<KV<String, Long>>> {
@Override
public PCollection<KV<String, Long>> expand(PCollection<String> lines) {
// Convert lines of text into individual words.
PCollection<String> words = lines.apply(ParDo.of(new ExtractWordsFn()));
// Count the number of times each word occurs.
PCollection<KV<String, Long>> wordCounts = words.apply(Count.perElement());
return wordCounts;
}
}
}
| 4,106 | 0.71359 | 0.711641 | 113 | 35.336285 | 31.980251 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.389381 | false | false | 0 |
cf95b038cfdfd93a3d9c31e27af3600c4a597781 | 31,868,657,387,219 | e055e08dd45bcfd78f97c8af59b031d237b5e05f | /src/com/nix/tryout/problems/Palindrome.java | e6ed603c77060a8df60fabaa2e8b9488658e6512 | []
| no_license | nitinramachandran/Tryout | https://github.com/nitinramachandran/Tryout | 7275210bc4214b8af92ff283b9776056e110048e | be5e4636d2f2663603f5e5cb6e39f904ca476841 | refs/heads/master | 2023-03-16T18:39:29.929000 | 2023-03-05T05:37:50 | 2023-03-05T05:37:50 | 180,221,986 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.nix.tryout.problems;
public class Palindrome {
public static boolean isPalindrome(String word) {
int len = word.length();
char[] charArr = word.toLowerCase().toCharArray();
boolean val = true;
for(int i = len-1, j = 0; i >= len/2 && j <= len/2; --i, ++j ) {
if(j <= len || !(i == j)) {
if(!(charArr[i] == charArr[j])) {
val = false;
break;
}
else {
continue;
}
}
}
return val;
}
public static void main(String[] args) {
System.out.println(Palindrome.isPalindrome("NoooooAooooon"));
}
}
| UTF-8 | Java | 692 | java | Palindrome.java | Java | []
| null | []
| package com.nix.tryout.problems;
public class Palindrome {
public static boolean isPalindrome(String word) {
int len = word.length();
char[] charArr = word.toLowerCase().toCharArray();
boolean val = true;
for(int i = len-1, j = 0; i >= len/2 && j <= len/2; --i, ++j ) {
if(j <= len || !(i == j)) {
if(!(charArr[i] == charArr[j])) {
val = false;
break;
}
else {
continue;
}
}
}
return val;
}
public static void main(String[] args) {
System.out.println(Palindrome.isPalindrome("NoooooAooooon"));
}
}
| 692 | 0.465318 | 0.459538 | 28 | 23.678572 | 20.176105 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.357143 | false | false | 0 |
4a4b7e242946751fec54d25f7dcf6414d09ed32f | 31,868,657,384,815 | b35cca8e78beeb01d18c7d06a8886bc4624b2313 | /app/src/main/java/com/vehiclerental/contracts/ChangeBookingStatusContract.java | 4fef0dc12fdff29f4948271bae17fa86c06c8ed2 | [
"MIT"
]
| permissive | AlexisChevalier/CarRental-Android-Application | https://github.com/AlexisChevalier/CarRental-Android-Application | 49cfa42e6cb5127d5e747d8538c0c4fba5eb8b14 | d05e0469b914e0cf919b2920640d03755f1348b8 | refs/heads/master | 2021-01-20T19:57:44.732000 | 2020-03-30T12:25:39 | 2020-03-30T12:25:39 | 61,232,362 | 14 | 8 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* CarRental
*
* This file provides a light communication object representing the parameters for the change booking status action
*/
package com.vehiclerental.contracts;
public class ChangeBookingStatusContract {
public int bookingId;
public boolean bookingValidated;
}
| UTF-8 | Java | 287 | java | ChangeBookingStatusContract.java | Java | []
| null | []
| /**
* CarRental
*
* This file provides a light communication object representing the parameters for the change booking status action
*/
package com.vehiclerental.contracts;
public class ChangeBookingStatusContract {
public int bookingId;
public boolean bookingValidated;
}
| 287 | 0.777003 | 0.777003 | 12 | 22.916666 | 31.71608 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 0 |
c1aac9e3cfa74a2e376137d5712ec7ac801c1a3b | 8,589,934,643,489 | 9c61cb3b7ea49b24c6c4e22a46f549272f3a91f3 | /src/tr/edu/itu/cs/ben/ExhibitionEditForm.java | b8e0b4063f75bcaf5633ec0e2fad14cb7bdc2304 | []
| no_license | BenjaminTekeshanoski/painters | https://github.com/BenjaminTekeshanoski/painters | 9d15fd0a52f3ef89c0d9a9af94ae42062073982d | 39a56161aa5252ee22ed5afcfddb5e4f968cb03e | refs/heads/master | 2020-03-22T20:16:48.606000 | 2014-12-01T05:58:26 | 2014-12-01T05:58:26 | 140,563,419 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package tr.edu.itu.cs.ben;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
import tr.edu.itu.cs.db.WicketApplication;
public class ExhibitionEditForm extends Form {
private boolean newExhibition;
public ExhibitionEditForm(String id, Exhibition aExhibition,
boolean newExhibitionFlag) {
super(id);
CompoundPropertyModel model = new CompoundPropertyModel(aExhibition);
this.setModel(model);
this.add(new TextField("name"));
this.add(new TextField("year"));
this.add(new TextField("location"));
this.newExhibition = newExhibitionFlag;
}
@Override
public void onSubmit() {
Exhibition exhibition = (Exhibition) this.getModelObject();
WicketApplication app = (WicketApplication) this.getApplication();
IExhibitionCollection collection = app.getExhibitionCollection();
if (this.newExhibition) {
collection.addExhibition(exhibition);
} else {
collection.updateExhibition(exhibition);
}
this.setResponsePage(new ExhibitionDetailPage(exhibition));
}
}
| UTF-8 | Java | 1,269 | java | ExhibitionEditForm.java | Java | []
| null | []
| package tr.edu.itu.cs.ben;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
import tr.edu.itu.cs.db.WicketApplication;
public class ExhibitionEditForm extends Form {
private boolean newExhibition;
public ExhibitionEditForm(String id, Exhibition aExhibition,
boolean newExhibitionFlag) {
super(id);
CompoundPropertyModel model = new CompoundPropertyModel(aExhibition);
this.setModel(model);
this.add(new TextField("name"));
this.add(new TextField("year"));
this.add(new TextField("location"));
this.newExhibition = newExhibitionFlag;
}
@Override
public void onSubmit() {
Exhibition exhibition = (Exhibition) this.getModelObject();
WicketApplication app = (WicketApplication) this.getApplication();
IExhibitionCollection collection = app.getExhibitionCollection();
if (this.newExhibition) {
collection.addExhibition(exhibition);
} else {
collection.updateExhibition(exhibition);
}
this.setResponsePage(new ExhibitionDetailPage(exhibition));
}
}
| 1,269 | 0.670607 | 0.670607 | 39 | 30.538462 | 25.072046 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.538462 | false | false | 0 |
bb694a9e004305b9122b23c3c0686ba09960cc76 | 17,128,329,603,236 | 99f9483ef4cb314b7c0188a76b404e19095bcbeb | /dubbo-interface/src/main/java/cn/zcl/service/DubboService.java | ceed7dbebf0e7084bd1e240003e69f948a2089b9 | []
| no_license | zhaochanglin/springboot-dubbo | https://github.com/zhaochanglin/springboot-dubbo | 06670e5589b1b404d1bdba806a2daee0d8767e9a | f7350c35289b903be9a31d95914b4d1f0fcd88d3 | refs/heads/master | 2020-08-06T17:46:26.069000 | 2019-10-06T02:39:07 | 2019-10-06T02:39:07 | 213,097,170 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.zcl.service;
/**
* @Author Administrator
* @Date 2019/10/6 8:34
* DubboService
* @Version 1.0
**/
public interface DubboService {
public String helloDubbo(String name);
}
| UTF-8 | Java | 203 | java | DubboService.java | Java | [
{
"context": "package cn.zcl.service;\r\n\r\n/**\r\n * @Author Administrator\r\n * @Date 2019/10/6 8:34\r\n * DubboService\r\n * @Ve",
"end": 56,
"score": 0.9887890219688416,
"start": 43,
"tag": "NAME",
"value": "Administrator"
}
]
| null | []
| package cn.zcl.service;
/**
* @Author Administrator
* @Date 2019/10/6 8:34
* DubboService
* @Version 1.0
**/
public interface DubboService {
public String helloDubbo(String name);
}
| 203 | 0.650246 | 0.591133 | 11 | 16.454546 | 12.992051 | 42 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | false | false | 0 |
89d0267254cd0c8f024114ad7681653d77db5ff0 | 2,911,987,830,017 | 616e49941944824d6155f5f1256471467668a10e | /src/main/java/com/alexaExamples/AlexaUiResponse.java | 7c3afc26691f06885d67bccaf893b24cf8bd4480 | []
| no_license | RedbeardTheNinja/SimpleAlexaJavaLambda | https://github.com/RedbeardTheNinja/SimpleAlexaJavaLambda | d32bfddfa385904b4eedeb3898e49cb6af36f2b2 | e923e2249c1d791be3d07d1172750ed7b5ba7f2b | refs/heads/master | 2021-01-11T06:08:58.483000 | 2015-08-12T04:48:46 | 2015-08-12T04:48:46 | 40,580,156 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.alexaExamples;
//TODO get lombok working correctly in maven
public final class AlexaUiResponse {
private OutputSpeech outputSpeech;
private Card card;
private Reprompt reprompt;
private boolean shouldEndSession = true;
@java.beans.ConstructorProperties({"outputSpeech", "card", "reprompt", "shouldEndSession"})
public AlexaUiResponse(OutputSpeech outputSpeech, Card card, Reprompt reprompt, boolean shouldEndSession) {
this.outputSpeech = outputSpeech;
this.card = card;
this.reprompt = reprompt;
this.shouldEndSession = shouldEndSession;
}
public AlexaUiResponse() {
}
public OutputSpeech getOutputSpeech() {
return this.outputSpeech;
}
public Card getCard() {
return this.card;
}
public Reprompt getReprompt() {
return this.reprompt;
}
public boolean isShouldEndSession() {
return this.shouldEndSession;
}
public void setOutputSpeech(OutputSpeech outputSpeech) {
this.outputSpeech = outputSpeech;
}
public void setCard(Card card) {
this.card = card;
}
public void setReprompt(Reprompt reprompt) {
this.reprompt = reprompt;
}
public void setShouldEndSession(boolean shouldEndSession) {
this.shouldEndSession = shouldEndSession;
}
public boolean equals(Object o) {
if (o == this) return true;
if (!(o instanceof AlexaUiResponse)) return false;
final AlexaUiResponse other = (AlexaUiResponse) o;
final Object this$outputSpeech = this.outputSpeech;
final Object other$outputSpeech = other.outputSpeech;
if (this$outputSpeech == null ? other$outputSpeech != null : !this$outputSpeech.equals(other$outputSpeech))
return false;
final Object this$card = this.card;
final Object other$card = other.card;
if (this$card == null ? other$card != null : !this$card.equals(other$card)) return false;
final Object this$reprompt = this.reprompt;
final Object other$reprompt = other.reprompt;
if (this$reprompt == null ? other$reprompt != null : !this$reprompt.equals(other$reprompt)) return false;
if (this.shouldEndSession != other.shouldEndSession) return false;
return true;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $outputSpeech = this.outputSpeech;
result = result * PRIME + ($outputSpeech == null ? 0 : $outputSpeech.hashCode());
final Object $card = this.card;
result = result * PRIME + ($card == null ? 0 : $card.hashCode());
final Object $reprompt = this.reprompt;
result = result * PRIME + ($reprompt == null ? 0 : $reprompt.hashCode());
result = result * PRIME + (this.shouldEndSession ? 79 : 97);
return result;
}
public String toString() {
return "com.magic.pricelookup.AlexaUiResponse(outputSpeech=" + this.outputSpeech + ", card=" + this.card + ", reprompt=" + this.reprompt + ", shouldEndSession=" + this.shouldEndSession + ")";
}
}
| UTF-8 | Java | 3,128 | java | AlexaUiResponse.java | Java | []
| null | []
| package com.alexaExamples;
//TODO get lombok working correctly in maven
public final class AlexaUiResponse {
private OutputSpeech outputSpeech;
private Card card;
private Reprompt reprompt;
private boolean shouldEndSession = true;
@java.beans.ConstructorProperties({"outputSpeech", "card", "reprompt", "shouldEndSession"})
public AlexaUiResponse(OutputSpeech outputSpeech, Card card, Reprompt reprompt, boolean shouldEndSession) {
this.outputSpeech = outputSpeech;
this.card = card;
this.reprompt = reprompt;
this.shouldEndSession = shouldEndSession;
}
public AlexaUiResponse() {
}
public OutputSpeech getOutputSpeech() {
return this.outputSpeech;
}
public Card getCard() {
return this.card;
}
public Reprompt getReprompt() {
return this.reprompt;
}
public boolean isShouldEndSession() {
return this.shouldEndSession;
}
public void setOutputSpeech(OutputSpeech outputSpeech) {
this.outputSpeech = outputSpeech;
}
public void setCard(Card card) {
this.card = card;
}
public void setReprompt(Reprompt reprompt) {
this.reprompt = reprompt;
}
public void setShouldEndSession(boolean shouldEndSession) {
this.shouldEndSession = shouldEndSession;
}
public boolean equals(Object o) {
if (o == this) return true;
if (!(o instanceof AlexaUiResponse)) return false;
final AlexaUiResponse other = (AlexaUiResponse) o;
final Object this$outputSpeech = this.outputSpeech;
final Object other$outputSpeech = other.outputSpeech;
if (this$outputSpeech == null ? other$outputSpeech != null : !this$outputSpeech.equals(other$outputSpeech))
return false;
final Object this$card = this.card;
final Object other$card = other.card;
if (this$card == null ? other$card != null : !this$card.equals(other$card)) return false;
final Object this$reprompt = this.reprompt;
final Object other$reprompt = other.reprompt;
if (this$reprompt == null ? other$reprompt != null : !this$reprompt.equals(other$reprompt)) return false;
if (this.shouldEndSession != other.shouldEndSession) return false;
return true;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $outputSpeech = this.outputSpeech;
result = result * PRIME + ($outputSpeech == null ? 0 : $outputSpeech.hashCode());
final Object $card = this.card;
result = result * PRIME + ($card == null ? 0 : $card.hashCode());
final Object $reprompt = this.reprompt;
result = result * PRIME + ($reprompt == null ? 0 : $reprompt.hashCode());
result = result * PRIME + (this.shouldEndSession ? 79 : 97);
return result;
}
public String toString() {
return "com.magic.pricelookup.AlexaUiResponse(outputSpeech=" + this.outputSpeech + ", card=" + this.card + ", reprompt=" + this.reprompt + ", shouldEndSession=" + this.shouldEndSession + ")";
}
}
| 3,128 | 0.649936 | 0.646739 | 87 | 34.954021 | 33.750916 | 199 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.586207 | false | false | 0 |
08868847bb722a3fec25f7756e37995b19a4ea96 | 2,911,987,827,567 | ae2f39269b3bc7df1981ba21a58027c540763f4a | /spring-pageable/src/main/java/com/pageable/springpageable/entity/Bank.java | f589d69b510fc5e6ef017ce856124dcc4f5765ef | []
| no_license | dickanirwansyah/spring-boot-course | https://github.com/dickanirwansyah/spring-boot-course | 50599fea1302476ddd7404616420b9853842cbf8 | c496b89632226124360fb5064d3384e9ba893229 | refs/heads/master | 2023-04-27T04:46:42.645000 | 2020-05-11T11:28:52 | 2020-05-11T11:28:52 | 228,291,205 | 0 | 1 | null | false | 2023-04-14T17:54:55 | 2019-12-16T03:00:50 | 2020-05-11T11:29:41 | 2023-04-14T17:54:54 | 247 | 0 | 1 | 4 | Java | false | false | package com.pageable.springpageable.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "bank")
@Entity
public class Bank implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "user_id", nullable = false)
private int userId;
@Column(name = "bank_name", nullable = false)
private String bankName;
@Column(name = "address_bank", nullable = false)
private String addressBank;
//rekening
@Column(name = "number_account_bank", nullable = false)
private String NumberAccountBank;
//atas nama
@Column(name = "as_name", nullable = false)
private String asName;
}
| UTF-8 | Java | 874 | java | Bank.java | Java | []
| null | []
| package com.pageable.springpageable.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "bank")
@Entity
public class Bank implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "user_id", nullable = false)
private int userId;
@Column(name = "bank_name", nullable = false)
private String bankName;
@Column(name = "address_bank", nullable = false)
private String addressBank;
//rekening
@Column(name = "number_account_bank", nullable = false)
private String NumberAccountBank;
//atas nama
@Column(name = "as_name", nullable = false)
private String asName;
}
| 874 | 0.717391 | 0.717391 | 39 | 21.410257 | 18.070684 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.461538 | false | false | 0 |
a951a5302d3e6e6911d29fa2339e751c1da7578c | 29,042,568,895,757 | d93904bb6ed8248a8e5aac57c3d3b4da8726fabd | /src/_getRandom.java | 937f04f4ba546f1b7b442ac42505962ef1e2c2f1 | []
| no_license | qinjunu/leedcode | https://github.com/qinjunu/leedcode | 2dad04ed601c0175d3ac4ed3d900348f53c08132 | 9edf878277a0ac937feb856492aa84e87cc12446 | refs/heads/master | 2022-11-24T09:07:15.387000 | 2020-08-02T11:57:03 | 2020-08-02T11:57:03 | 283,409,606 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.Random;
public class _getRandom {
public int getRandom(ListNode head) {
Random rand = new Random();
ListNode p = head;
int i = 0;
int ans = 0;
while(p != null) {
// [0, i): 1 / i
if(rand.nextInt(++i) == 0) {
ans = p.val;
}
p = p.next;
}
return ans;
}
public int[] getKRandom(ListNode head, int k) {
Random rand = new Random();
ListNode p = head;
int[] ans = new int[k];
int i = 0;
// 前 k 个元素先默认选上,后面更新
for(; i < k && p != null; i++) {
ans[i] = p.val;
p = p.next;
}
// i = k
while(p != null) {
// 同时更新 ans[j] 的内容
int j = rand.nextInt(++i);
if(j < k) {
ans[j] = p.val;
}
p = p.next;
}
return ans;
}
}
| GB18030 | Java | 825 | java | _getRandom.java | Java | []
| null | []
| import java.util.Random;
public class _getRandom {
public int getRandom(ListNode head) {
Random rand = new Random();
ListNode p = head;
int i = 0;
int ans = 0;
while(p != null) {
// [0, i): 1 / i
if(rand.nextInt(++i) == 0) {
ans = p.val;
}
p = p.next;
}
return ans;
}
public int[] getKRandom(ListNode head, int k) {
Random rand = new Random();
ListNode p = head;
int[] ans = new int[k];
int i = 0;
// 前 k 个元素先默认选上,后面更新
for(; i < k && p != null; i++) {
ans[i] = p.val;
p = p.next;
}
// i = k
while(p != null) {
// 同时更新 ans[j] 的内容
int j = rand.nextInt(++i);
if(j < k) {
ans[j] = p.val;
}
p = p.next;
}
return ans;
}
}
| 825 | 0.453384 | 0.445722 | 51 | 13.352942 | 11.519504 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.45098 | false | false | 0 |
567c0f585c9439c5d5000bb5e219ec4666f2b4b4 | 24,867,860,674,963 | 35826be5b60665e3774fe7409fe213b067137cfb | /Git/src/main/java/me/heldplayer/irc/git/internal/security/rules/RequireNone.java | 31249409dc536a0b1c56e63d79dfedbebf5e47f5 | []
| no_license | heldplayer/GitIRC | https://github.com/heldplayer/GitIRC | 7c60902d008fbaa4f7c8130859d67aa1e9383201 | 94cd9d9957ea19975ff4ab36d5f297e76d444e21 | refs/heads/master | 2016-09-05T20:58:48.267000 | 2014-07-26T08:53:38 | 2014-07-26T08:53:38 | 3,891,916 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package me.heldplayer.irc.git.internal.security.rules;
import me.heldplayer.irc.git.RequestSource;
import me.heldplayer.irc.git.internal.security.AccessManager;
import me.heldplayer.util.json.JSONArray;
import me.heldplayer.util.json.JSONObject;
import java.util.ArrayList;
public class RequireNone implements Rule {
private ArrayList<Rule> rules;
public RequireNone(JSONObject object) {
JSONArray values = object.getArray("value");
this.rules = new ArrayList<Rule>();
for (int i = 0; i < values.size(); i++) {
JSONObject obj = values.getObject(i);
this.rules.add(AccessManager.createRule(obj));
}
}
@Override
public boolean checkAccess(RequestSource source) {
for (Rule rule : this.rules) {
if (rule.checkAccess(source)) {
return false;
}
}
return true;
}
}
| UTF-8 | Java | 910 | java | RequireNone.java | Java | []
| null | []
| package me.heldplayer.irc.git.internal.security.rules;
import me.heldplayer.irc.git.RequestSource;
import me.heldplayer.irc.git.internal.security.AccessManager;
import me.heldplayer.util.json.JSONArray;
import me.heldplayer.util.json.JSONObject;
import java.util.ArrayList;
public class RequireNone implements Rule {
private ArrayList<Rule> rules;
public RequireNone(JSONObject object) {
JSONArray values = object.getArray("value");
this.rules = new ArrayList<Rule>();
for (int i = 0; i < values.size(); i++) {
JSONObject obj = values.getObject(i);
this.rules.add(AccessManager.createRule(obj));
}
}
@Override
public boolean checkAccess(RequestSource source) {
for (Rule rule : this.rules) {
if (rule.checkAccess(source)) {
return false;
}
}
return true;
}
}
| 910 | 0.642857 | 0.641758 | 33 | 26.575758 | 21.207533 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.454545 | false | false | 0 |
56f51c2ef4b8fcf96aa02ac5816a6ddef3e548a7 | 23,476,291,283,928 | faf3a1ee168fedcd6b3a4a3d7dee75fc6a03f6e1 | /app/src/main/java/com/popdq/app/AZGalleryActivity.java | 12110562872334c1b80e8cb7dedd8d075af82435 | []
| no_license | curest0x1021/PopDQ-Android | https://github.com/curest0x1021/PopDQ-Android | bb8a1aeeba322d3723c589b0015ae3b49b718bbf | 112f04e3871830a30ce007fd9ada828e81ea799f | refs/heads/master | 2020-05-18T19:59:37.175000 | 2017-02-14T12:11:03 | 2017-02-14T12:11:03 | 184,621,088 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.popdq.app;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import com.popdq.libs.AZCommon;
import com.popdq.libs.AZDirectory;
import com.popdq.libs.AZDirectoryAdapter;
import com.popdq.libs.AZPhoto;
import com.popdq.libs.AzDialog;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
public class AZGalleryActivity extends AppCompatActivity {
private ArrayList<AZDirectory> mDirectories;
private GridView gvGalery;
private AZDirectoryAdapter mAdapter;
// private TextView tvNumSelected;
// private ImageButton btnOk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.azstack_gallery);
initActionbar();
// init common
AZCommon.mDirectorySelected = null;
AZCommon.numSelected = 0;
AZCommon.isSendClicked = false;
// initStorageDirectory();
setComponentView();
setViewListener();
mDirectories = getListDirectory();
mAdapter = new AZDirectoryAdapter(getBaseContext(), mDirectories);
gvGalery.setAdapter(mAdapter);
mAdapter.notifyDataSetChanged();
}
@Override
public void onResume() {
super.onResume();
if (AZCommon.isSendClicked) {
onButtonSendClick();
}
}
@Override
public void onBackPressed() {
if (AZCommon.numSelected > 0) {
AzDialog dialog = new AzDialog(AZGalleryActivity.this);
dialog.setContent(getString(R.string.azstack_discard_image_select, AZCommon.numSelected));
dialog.setNegative(getString(R.string.cancel), null);
dialog.setPositive(getString(R.string.ok), new AzDialog.BtnDialogListener() {
@Override
public void onClick() {
AZCommon.numSelected = 0;
onBackPressed();
}
});
dialog.show();
} else {
finish();
super.onBackPressed();
}
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem sendItem = menu.findItem(R.id.azstack_menu_send);
sendItem.setVisible(false);
if (AZCommon.numSelected > 0) {
sendItem.setVisible(true);
} else {
sendItem.setVisible(false);
}
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.azstack_menu_send, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int menuItemId = item.getItemId();
if (menuItemId == android.R.id.home) {
onBackPressed();
} else if (menuItemId == R.id.azstack_menu_send) {
onButtonSendClick();
}
return true;
}
private void initActionbar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(R.string.choose_photo);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
}
private void setComponentView() {
gvGalery = (GridView) findViewById(R.id.gv_galery);
}
private void setViewListener() {
gvGalery.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
Intent intent = new Intent(getBaseContext(), AZDirectoryActivity.class);
AZCommon.mDirectorySelected = (AZDirectory) mAdapter.getItem(pos);
startActivity(intent);
}
});
}
private ArrayList<AZDirectory> getListDirectory() {
ArrayList<AZDirectory> directoryList = new ArrayList<AZDirectory>();
HashMap<String, AZDirectory> hashMap = new HashMap<String, AZDirectory>();
try {
final String[] projection = {MediaStore.Images.Media.DISPLAY_NAME, MediaStore.Images.Media.DATA,
MediaStore.Images.Media._ID, MediaStore.Images.Media.DATE_ADDED};
final String orderBy = MediaStore.Images.Media.DATE_ADDED + " DESC";
Cursor cursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null,
null, orderBy);
if (cursor == null)
return null;
AZDirectory dir = null;
while (cursor.moveToNext()) {
String imageName = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DISPLAY_NAME));
String imagePath = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA));
String imageDate = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED));
String parentPath = getParentPath(imagePath);
String parentName = getParentName(imagePath);
if (parentPath != null) {
dir = hashMap.get(parentPath);
if (dir == null) {
dir = new AZDirectory();
dir.setPath(parentPath);
dir.setName(parentName);
dir.setDate(imageDate);
hashMap.put(parentPath, dir);
}
AZPhoto image = new AZPhoto();
image.setPath(imagePath);
image.setName(imageName);
image.setSelected(false);
dir.addImage(image);
}
}
directoryList.addAll(hashMap.values());
} catch (Exception e) {
e.printStackTrace();
}
// soft
directoryList = softDirectory(directoryList);
return directoryList;
}
public static ArrayList<AZDirectory> softDirectory(ArrayList<AZDirectory> dirs) {
Collections.sort(dirs, new Comparator<AZDirectory>() {
@Override
public int compare(AZDirectory dir1, AZDirectory dir2) {
return dir2.getDate().compareTo(dir1.getDate());
}
});
return dirs;
}
private String getParentPath(String filePath) {
if (filePath == null)
return "Other";
File file = new File(filePath);
if (file.exists()) {
return file.getParent();
} else {
// reget with error file
// String temp = filePath.substring(0, filePath.lastIndexOf("/"));
return null;
}
}
private String getParentName(String filePath) {
if (filePath == null)
return "Other";
File file = new File(filePath);
if (file.exists()) {
return file.getParentFile().getName();
} else {
String temp = filePath.substring(0, filePath.lastIndexOf("/"));
if (temp.indexOf("/") > 0) {
temp = temp.substring(filePath.lastIndexOf("/"));
return temp;
}
}
return "Other";
}
public void onButtonSendClick() {
AZCommon.isSendClicked = false;
Intent intent = new Intent();
if (AZCommon.numSelected > 0) {
ArrayList<AZPhoto> listImageSelected = new ArrayList<AZPhoto>();
for (AZDirectory dir : mDirectories) {
for (AZPhoto image : dir.getListImage()) {
if (image.isSelected()) {
listImageSelected.add(image);
}
}
}
intent.putExtra("listImageSelected", listImageSelected);
setResult(RESULT_OK, intent);
} else {
setResult(RESULT_CANCELED);
}
finish();
}
}
| UTF-8 | Java | 8,470 | java | AZGalleryActivity.java | Java | []
| null | []
| package com.popdq.app;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import com.popdq.libs.AZCommon;
import com.popdq.libs.AZDirectory;
import com.popdq.libs.AZDirectoryAdapter;
import com.popdq.libs.AZPhoto;
import com.popdq.libs.AzDialog;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
public class AZGalleryActivity extends AppCompatActivity {
private ArrayList<AZDirectory> mDirectories;
private GridView gvGalery;
private AZDirectoryAdapter mAdapter;
// private TextView tvNumSelected;
// private ImageButton btnOk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.azstack_gallery);
initActionbar();
// init common
AZCommon.mDirectorySelected = null;
AZCommon.numSelected = 0;
AZCommon.isSendClicked = false;
// initStorageDirectory();
setComponentView();
setViewListener();
mDirectories = getListDirectory();
mAdapter = new AZDirectoryAdapter(getBaseContext(), mDirectories);
gvGalery.setAdapter(mAdapter);
mAdapter.notifyDataSetChanged();
}
@Override
public void onResume() {
super.onResume();
if (AZCommon.isSendClicked) {
onButtonSendClick();
}
}
@Override
public void onBackPressed() {
if (AZCommon.numSelected > 0) {
AzDialog dialog = new AzDialog(AZGalleryActivity.this);
dialog.setContent(getString(R.string.azstack_discard_image_select, AZCommon.numSelected));
dialog.setNegative(getString(R.string.cancel), null);
dialog.setPositive(getString(R.string.ok), new AzDialog.BtnDialogListener() {
@Override
public void onClick() {
AZCommon.numSelected = 0;
onBackPressed();
}
});
dialog.show();
} else {
finish();
super.onBackPressed();
}
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem sendItem = menu.findItem(R.id.azstack_menu_send);
sendItem.setVisible(false);
if (AZCommon.numSelected > 0) {
sendItem.setVisible(true);
} else {
sendItem.setVisible(false);
}
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.azstack_menu_send, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int menuItemId = item.getItemId();
if (menuItemId == android.R.id.home) {
onBackPressed();
} else if (menuItemId == R.id.azstack_menu_send) {
onButtonSendClick();
}
return true;
}
private void initActionbar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(R.string.choose_photo);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
}
private void setComponentView() {
gvGalery = (GridView) findViewById(R.id.gv_galery);
}
private void setViewListener() {
gvGalery.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
Intent intent = new Intent(getBaseContext(), AZDirectoryActivity.class);
AZCommon.mDirectorySelected = (AZDirectory) mAdapter.getItem(pos);
startActivity(intent);
}
});
}
private ArrayList<AZDirectory> getListDirectory() {
ArrayList<AZDirectory> directoryList = new ArrayList<AZDirectory>();
HashMap<String, AZDirectory> hashMap = new HashMap<String, AZDirectory>();
try {
final String[] projection = {MediaStore.Images.Media.DISPLAY_NAME, MediaStore.Images.Media.DATA,
MediaStore.Images.Media._ID, MediaStore.Images.Media.DATE_ADDED};
final String orderBy = MediaStore.Images.Media.DATE_ADDED + " DESC";
Cursor cursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null,
null, orderBy);
if (cursor == null)
return null;
AZDirectory dir = null;
while (cursor.moveToNext()) {
String imageName = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DISPLAY_NAME));
String imagePath = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA));
String imageDate = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED));
String parentPath = getParentPath(imagePath);
String parentName = getParentName(imagePath);
if (parentPath != null) {
dir = hashMap.get(parentPath);
if (dir == null) {
dir = new AZDirectory();
dir.setPath(parentPath);
dir.setName(parentName);
dir.setDate(imageDate);
hashMap.put(parentPath, dir);
}
AZPhoto image = new AZPhoto();
image.setPath(imagePath);
image.setName(imageName);
image.setSelected(false);
dir.addImage(image);
}
}
directoryList.addAll(hashMap.values());
} catch (Exception e) {
e.printStackTrace();
}
// soft
directoryList = softDirectory(directoryList);
return directoryList;
}
public static ArrayList<AZDirectory> softDirectory(ArrayList<AZDirectory> dirs) {
Collections.sort(dirs, new Comparator<AZDirectory>() {
@Override
public int compare(AZDirectory dir1, AZDirectory dir2) {
return dir2.getDate().compareTo(dir1.getDate());
}
});
return dirs;
}
private String getParentPath(String filePath) {
if (filePath == null)
return "Other";
File file = new File(filePath);
if (file.exists()) {
return file.getParent();
} else {
// reget with error file
// String temp = filePath.substring(0, filePath.lastIndexOf("/"));
return null;
}
}
private String getParentName(String filePath) {
if (filePath == null)
return "Other";
File file = new File(filePath);
if (file.exists()) {
return file.getParentFile().getName();
} else {
String temp = filePath.substring(0, filePath.lastIndexOf("/"));
if (temp.indexOf("/") > 0) {
temp = temp.substring(filePath.lastIndexOf("/"));
return temp;
}
}
return "Other";
}
public void onButtonSendClick() {
AZCommon.isSendClicked = false;
Intent intent = new Intent();
if (AZCommon.numSelected > 0) {
ArrayList<AZPhoto> listImageSelected = new ArrayList<AZPhoto>();
for (AZDirectory dir : mDirectories) {
for (AZPhoto image : dir.getListImage()) {
if (image.isSelected()) {
listImageSelected.add(image);
}
}
}
intent.putExtra("listImageSelected", listImageSelected);
setResult(RESULT_OK, intent);
} else {
setResult(RESULT_CANCELED);
}
finish();
}
}
| 8,470 | 0.594215 | 0.592208 | 258 | 31.829458 | 25.39353 | 120 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.593023 | false | false | 0 |
00d29e1a882a8a0c37bf73aefe4d753651daa7e9 | 20,607,253,115,518 | fa2d04e6a221437acc99b860f7565d21b0f3f456 | /src/_168_Excel_Sheet_Column_Title.java | 7e7d25f68eb0cc187ca529f1a2a56fe99a508d83 | []
| no_license | ravireddy76/Algorithm | https://github.com/ravireddy76/Algorithm | 9f010caa9f6389f6658b73a2f593b7b61a368814 | 7531301fc2e8ac6983e1ec9b4b6e815d71b5ccda | refs/heads/master | 2021-09-10T20:01:01.379000 | 2018-04-01T06:10:02 | 2018-04-01T06:10:02 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
* Given a positive integer, return its corresponding column title as appear in an Excel sheet.
*
* For example:
*
* 1 -> A
* 2 -> B
* 3 -> C
* ...
* 26 -> Z
* 27 -> AA
* 28 -> AB
* Credits:
* Special thanks to @ifanchu for adding this problem and creating all test cases.
* @author Shengyi
*
*/
public class _168_Excel_Sheet_Column_Title {
//Redo
public static String convertToTitle(int n) {
if (n == 0) {
return "";
}
String result = "";
while (n - 1 >= 0) {
int temp = (n - 1) % 26;
result = (char)(temp + 'A') + result;
n = (n - 1) / 26;
}
return result;
}
public static void main(String[] args) {
System.out.println(convertToTitle(2));
}
}
| UTF-8 | Java | 864 | java | _168_Excel_Sheet_Column_Title.java | Java | [
{
"context": "* 28 -> AB \r\n * Credits:\r\n * Special thanks to @ifanchu for adding this problem and creating all test cas",
"end": 284,
"score": 0.9997014999389648,
"start": 276,
"tag": "USERNAME",
"value": "@ifanchu"
},
{
"context": "s problem and creating all test cases.\r\n * @author Shengyi\r\n *\r\n */\r\n\r\npublic class _168_Excel_Sheet_Column_",
"end": 357,
"score": 0.9970595240592957,
"start": 350,
"tag": "NAME",
"value": "Shengyi"
}
]
| null | []
| /**
*
* Given a positive integer, return its corresponding column title as appear in an Excel sheet.
*
* For example:
*
* 1 -> A
* 2 -> B
* 3 -> C
* ...
* 26 -> Z
* 27 -> AA
* 28 -> AB
* Credits:
* Special thanks to @ifanchu for adding this problem and creating all test cases.
* @author Shengyi
*
*/
public class _168_Excel_Sheet_Column_Title {
//Redo
public static String convertToTitle(int n) {
if (n == 0) {
return "";
}
String result = "";
while (n - 1 >= 0) {
int temp = (n - 1) % 26;
result = (char)(temp + 'A') + result;
n = (n - 1) / 26;
}
return result;
}
public static void main(String[] args) {
System.out.println(convertToTitle(2));
}
}
| 864 | 0.466435 | 0.440972 | 41 | 19.073172 | 20.477697 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.463415 | false | false | 0 |
395e4922f7075b5970dd22642f5f60e6fce86eda | 13,572,096,722,403 | b9c0ef64fca92fe4a2c8b6b97345b5610f684a55 | /app/src/main/java/com/example/rog/myapplication/presenter/UserPresenter.java | ca4c3930ce13da49f60c894b5d3be3851f16c393 | []
| no_license | WorldSorry/AAA | https://github.com/WorldSorry/AAA | 280b5446fa14d4fcce5b1bf6aa23080114f76d32 | ea5bf3d02a507c8e753e0ffd3e075c5b7002712e | refs/heads/master | 2021-01-19T01:41:14.570000 | 2017-03-11T11:55:19 | 2017-03-11T11:55:19 | 84,300,242 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.rog.myapplication.presenter;
/**
* Created by ROG on 2017/3/4.
*/
public class UserPresenter {
}
| UTF-8 | Java | 122 | java | UserPresenter.java | Java | [
{
"context": "le.rog.myapplication.presenter;\n\n/**\n * Created by ROG on 2017/3/4.\n */\n\npublic class UserPresenter {\n\n}",
"end": 71,
"score": 0.9992294311523438,
"start": 68,
"tag": "USERNAME",
"value": "ROG"
}
]
| null | []
| package com.example.rog.myapplication.presenter;
/**
* Created by ROG on 2017/3/4.
*/
public class UserPresenter {
}
| 122 | 0.704918 | 0.655738 | 9 | 12.555555 | 16.958191 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | false | false | 0 |
2cbbbff49a2d3a82a4c168d29168f1631f47d3ce | 12,799,002,597,874 | 766b93d6d77fc68f9f353023c799b2e72c204489 | /src/domainless/xkilloverscroll/KillOverscrollMod.java | 18a3c93118613bd632e3b09367285a988ffe8eaa | []
| no_license | mukel/XKillOverscroll | https://github.com/mukel/XKillOverscroll | 1437b1ace6f2f65be601c80a10b6f75879eb9cc3 | 44e8f8c926abb9a13029bd7e28fdd12db018dc4e | refs/heads/master | 2020-05-16T08:30:46.073000 | 2013-10-16T00:38:40 | 2013-10-16T00:38:40 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package domainless.xkilloverscroll;
import android.widget.AbsListView;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
public class KillOverscrollMod implements IXposedHookZygoteInit {
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
XposedBridge.hookAllMethods(AbsListView.class, "initAbsListView", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.setIntField(param.thisObject, "mOverscrollDistance", 0);
XposedHelpers.setIntField(param.thisObject, "mOverflingDistance", 0);
}
});
}
}
| UTF-8 | Java | 754 | java | KillOverscrollMod.java | Java | []
| null | []
| package domainless.xkilloverscroll;
import android.widget.AbsListView;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
public class KillOverscrollMod implements IXposedHookZygoteInit {
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
XposedBridge.hookAllMethods(AbsListView.class, "initAbsListView", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.setIntField(param.thisObject, "mOverscrollDistance", 0);
XposedHelpers.setIntField(param.thisObject, "mOverflingDistance", 0);
}
});
}
}
| 754 | 0.806366 | 0.803714 | 20 | 36.700001 | 29.841413 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false | 0 |
a633fda903d905a9066647107ac84b0203debdac | 21,380,347,268,691 | a6e973dbb3d0557d4164dd55c895ac76f562d3b3 | /src/main/java/bd/ac/buet/TopicsModeling/models/PostTags.java | 550095e82cd3bd5e278b0e31f9330b8b023e1ce9 | []
| no_license | monjurmorshed793/TopicsModelingReactor | https://github.com/monjurmorshed793/TopicsModelingReactor | 4d5d3bce9cb937d4f2210c2c189835bd44cb17c3 | 45a7107393352d1b0e14788833f5908a268d10e8 | refs/heads/main | 2023-05-07T04:20:06.708000 | 2021-06-03T17:52:19 | 2021-06-03T17:52:19 | 373,595,573 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package bd.ac.buet.TopicsModeling.models;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table("PostTags")
public class PostTags {
@Id
@Column("Id")
private Long id;
@Column("PostId")
private Long postId;
@Column("TagId")
private Long tagId;
}
| UTF-8 | Java | 566 | java | PostTags.java | Java | []
| null | []
| package bd.ac.buet.TopicsModeling.models;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table("PostTags")
public class PostTags {
@Id
@Column("Id")
private Long id;
@Column("PostId")
private Long postId;
@Column("TagId")
private Long tagId;
}
| 566 | 0.768551 | 0.768551 | 24 | 22.583334 | 16.633091 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.458333 | false | false | 0 |
d2622b5e102062ae8fc5629c057a31b41def8f9f | 9,294,309,284,072 | 48d67140a422b9186992f1c7980282b638bd331c | /trunk/core/src/main/java/com/zjnan/app/model/BaseObject.java | ae66e578bd48fc1f5da7ef31792232cc1a02ee63 | []
| no_license | BGCX261/zjnan-svn-to-git | https://github.com/BGCX261/zjnan-svn-to-git | bde0fd1d8c759a4b2e7a3720a9d83e837a920db0 | 95fa782346493bfcabb8b54dd95507e209a91097 | refs/heads/master | 2020-05-17T13:27:57.354000 | 2015-08-25T15:32:49 | 2015-08-25T15:32:49 | 41,502,328 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zjnan.app.model;
import java.io.Serializable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
/**
* Base class for Model objects. Child objects should implement toString(),
* equals() and hashCode().
*
* @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
*/
@MappedSuperclass
public abstract class BaseObject implements Serializable {
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* Common implement equals method
*/
public boolean equals( Object obj )
{
if( this==obj ) return true;
if( !( obj instanceof BaseObject ) )
return false;
BaseObject target = (BaseObject)obj;
if( this.getId()!=null )
{
return this.getId().equals( target.getId() );
}
if( target.getId()!=null )
{
return false;
}
return EqualsBuilder.reflectionEquals(this, obj);
}
/**
* Generate the hash code
*/
public int hashCode()
{
if( this.getId()!= null )
{
return this.getId().hashCode();
}
return HashCodeBuilder.reflectionHashCode(this);
}
/**
* Common implement toString method
*/
public String toString()
{
return ReflectionToStringBuilder.toString( this );
}
}
| UTF-8 | Java | 1,828 | java | BaseObject.java | Java | [
{
"context": "() and hashCode().\n * \n * @author <a href=\"mailto:matt@raibledesigns.com\">Matt Raible</a>\n */\n@MappedSuperclass\npublic abs",
"end": 554,
"score": 0.9999287724494934,
"start": 532,
"tag": "EMAIL",
"value": "matt@raibledesigns.com"
},
{
"context": "* @author <a href=\"mailto:matt@raibledesigns.com\">Matt Raible</a>\n */\n@MappedSuperclass\npublic abstract class B",
"end": 567,
"score": 0.9998897314071655,
"start": 556,
"tag": "NAME",
"value": "Matt Raible"
}
]
| null | []
| package com.zjnan.app.model;
import java.io.Serializable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
/**
* Base class for Model objects. Child objects should implement toString(),
* equals() and hashCode().
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
*/
@MappedSuperclass
public abstract class BaseObject implements Serializable {
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* Common implement equals method
*/
public boolean equals( Object obj )
{
if( this==obj ) return true;
if( !( obj instanceof BaseObject ) )
return false;
BaseObject target = (BaseObject)obj;
if( this.getId()!=null )
{
return this.getId().equals( target.getId() );
}
if( target.getId()!=null )
{
return false;
}
return EqualsBuilder.reflectionEquals(this, obj);
}
/**
* Generate the hash code
*/
public int hashCode()
{
if( this.getId()!= null )
{
return this.getId().hashCode();
}
return HashCodeBuilder.reflectionHashCode(this);
}
/**
* Common implement toString method
*/
public String toString()
{
return ReflectionToStringBuilder.toString( this );
}
}
| 1,808 | 0.601751 | 0.601751 | 81 | 21.567902 | 20.200806 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.283951 | false | false | 0 |
77664c4d0960ceff99d48322a074cfa4d69fde1a | 4,612,794,934,927 | 4ce4ba657c3a1a832ab7407ade6692be51259e4e | /example/javaexmaple/src/net/ProtocolTester.java | 4fbd1537431b3f8c7ae3fcd89e162f3b054506db | []
| no_license | ninepillars/trunk | https://github.com/ninepillars/trunk | 0efe0d30a17ee5db939a1e44aedc1fd72ab681d6 | 41378b7d9ab6d12b5bccbf248df4330dbd1296c8 | refs/heads/master | 2020-12-28T23:04:52.570000 | 2015-05-25T06:50:12 | 2015-05-25T06:50:12 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net;
import java.net.MalformedURLException;
import java.net.URL;
public class ProtocolTester {
public static void main(String[] args) {
testProtocol("http://www.adc.org");// 超文本传输协议http
testProtocol("https://www.amazon.com/exec/obidos/order2/"); // 安全http
testProtocol("ftp://metalab.unc.edu/pub/lanaguages/java/javafag/");// 文件传输协议
testProtocol("mailto:elharo@metalab.unc.edu");// 简单邮件传输协议
testProtocol("telnet://dibner.poly.edu");// telnet
testProtocol("file://c:/");// 本地文件访问
testProtocol("gopher://gopher.anc.org.za/");// gopher
testProtocol("ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress");// 轻量级目录访问
testProtocol("jar:http://cafeaulait.org/books/javaio/ioexamples/javaio.jar!" + "/com/macfaq/io/StreamCopier.class");// JAR
testProtocol("nfs://utopia.poly.edu/usr/tmp");// NFS,网络文件系统
testProtocol("jdbc:mysql://luna.metalab.unc.edu:3306/NEWS");// JDBC 定制协议
testProtocol("rmi://metalab.unc.edu/RenderEngine"); // rmi 远程方法调用定制协议
// HotJava定制协议
testProtocol("doc:/UsersGuide/release.html");
testProtocol("netdoc:/UsersGuide/release.html");
testProtocol("systemresource://www.adc.org/+/index.html");
}
public static void testProtocol(String url) {
try {
URL u = new URL(url);
System.out.println(u.getProtocol() + " is supported.");
} catch (MalformedURLException e) {
String protocol = url.substring(0, url.indexOf(":"));
System.err.println(protocol + " is not supported.");
}
}
}
| UTF-8 | Java | 1,794 | java | ProtocolTester.java | Java | [
{
"context": "avafag/\");// 文件传输协议\r\n testProtocol(\"mailto:elharo@metalab.unc.edu\");// 简单邮件传输协议\r\n testProtocol(\"telnet://dib",
"end": 432,
"score": 0.9999316930770874,
"start": 410,
"tag": "EMAIL",
"value": "elharo@metalab.unc.edu"
}
]
| null | []
| package net;
import java.net.MalformedURLException;
import java.net.URL;
public class ProtocolTester {
public static void main(String[] args) {
testProtocol("http://www.adc.org");// 超文本传输协议http
testProtocol("https://www.amazon.com/exec/obidos/order2/"); // 安全http
testProtocol("ftp://metalab.unc.edu/pub/lanaguages/java/javafag/");// 文件传输协议
testProtocol("mailto:<EMAIL>");// 简单邮件传输协议
testProtocol("telnet://dibner.poly.edu");// telnet
testProtocol("file://c:/");// 本地文件访问
testProtocol("gopher://gopher.anc.org.za/");// gopher
testProtocol("ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress");// 轻量级目录访问
testProtocol("jar:http://cafeaulait.org/books/javaio/ioexamples/javaio.jar!" + "/com/macfaq/io/StreamCopier.class");// JAR
testProtocol("nfs://utopia.poly.edu/usr/tmp");// NFS,网络文件系统
testProtocol("jdbc:mysql://luna.metalab.unc.edu:3306/NEWS");// JDBC 定制协议
testProtocol("rmi://metalab.unc.edu/RenderEngine"); // rmi 远程方法调用定制协议
// HotJava定制协议
testProtocol("doc:/UsersGuide/release.html");
testProtocol("netdoc:/UsersGuide/release.html");
testProtocol("systemresource://www.adc.org/+/index.html");
}
public static void testProtocol(String url) {
try {
URL u = new URL(url);
System.out.println(u.getProtocol() + " is supported.");
} catch (MalformedURLException e) {
String protocol = url.substring(0, url.indexOf(":"));
System.err.println(protocol + " is not supported.");
}
}
}
| 1,779 | 0.626643 | 0.620669 | 36 | 44.5 | 32.306259 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.694444 | false | false | 0 |
dc1cf18f8035ef65ab56b85aad7027b6d1baa04b | 20,804,821,642,686 | e35a48c6b76dba39a0c55adfb3b6d8885a454428 | /ShutaoDemo/src/main/java/shutao/io/nio/NioClient.java | 44801611cc63241ca7512f600c90b70838d27487 | []
| no_license | shenshutao/java | https://github.com/shenshutao/java | 29c0d714c21423fbcc245650a7f501e848d169e8 | 073db24b2557ce420dcfa4dbe5ea6340dc888d59 | refs/heads/master | 2021-01-20T00:47:51.899000 | 2018-06-28T07:53:49 | 2018-06-28T07:53:49 | 89,190,948 | 0 | 0 | null | false | 2017-07-17T08:09:33 | 2017-04-24T02:48:08 | 2017-06-09T04:04:42 | 2017-07-17T08:09:33 | 86 | 0 | 0 | 0 | Java | null | null | package shutao.io.nio;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
public class NioClient {
SocketChannel client;
Selector selector;
ByteBuffer receiveBuff = ByteBuffer.allocate(1024);
ByteBuffer sendBuff = ByteBuffer.allocate(1024);
InetSocketAddress serverAddress = new InetSocketAddress("localhost", 8000);
public NioClient() throws IOException {
/**
* start an channel
*/
client = SocketChannel.open();
client.configureBlocking(false);
client.connect(serverAddress);
/**
* Start a selector
*/
selector = Selector.open();
client.register(selector, SelectionKey.OP_CONNECT);
}
public void session() throws IOException {
if (client.isConnectionPending()) {
client.finishConnect();
System.out.println("Type your name in console:");
client.register(selector, SelectionKey.OP_WRITE);
}
Scanner scan = new Scanner(System.in);
while (scan.hasNextLine()) {
String name = scan.nextLine();
if ("".equals(name)) {
continue;
}
process(name);
System.out.println("Type your name in console:");
}
}
private void process(String name) throws IOException {
boolean unFinish = true;
while (unFinish) {
int i = selector.select();
if (i == 0) {
return;
}
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> iterator = keys.iterator();
while (iterator.hasNext()) {
SelectionKey key = iterator.next();
if (key.isWritable()) { // check if can write data
sendBuff.clear();
sendBuff.put(name.getBytes());
sendBuff.flip();
client.write(sendBuff);
client.register(selector, SelectionKey.OP_READ);
} else if (key.isReadable()) { // check if can read data
receiveBuff.clear();
int len = client.read(receiveBuff);
if (len > 0) {
String msg = new String(receiveBuff.array(), 0, len);
System.out.println("Receive message from server: " + msg);
client.register(selector, SelectionKey.OP_WRITE);
unFinish = false;
}
}
iterator.remove();
}
}
}
public static void main(String[] args) throws IOException {
new NioClient().session();
}
}
| UTF-8 | Java | 2,373 | java | NioClient.java | Java | []
| null | []
| package shutao.io.nio;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
public class NioClient {
SocketChannel client;
Selector selector;
ByteBuffer receiveBuff = ByteBuffer.allocate(1024);
ByteBuffer sendBuff = ByteBuffer.allocate(1024);
InetSocketAddress serverAddress = new InetSocketAddress("localhost", 8000);
public NioClient() throws IOException {
/**
* start an channel
*/
client = SocketChannel.open();
client.configureBlocking(false);
client.connect(serverAddress);
/**
* Start a selector
*/
selector = Selector.open();
client.register(selector, SelectionKey.OP_CONNECT);
}
public void session() throws IOException {
if (client.isConnectionPending()) {
client.finishConnect();
System.out.println("Type your name in console:");
client.register(selector, SelectionKey.OP_WRITE);
}
Scanner scan = new Scanner(System.in);
while (scan.hasNextLine()) {
String name = scan.nextLine();
if ("".equals(name)) {
continue;
}
process(name);
System.out.println("Type your name in console:");
}
}
private void process(String name) throws IOException {
boolean unFinish = true;
while (unFinish) {
int i = selector.select();
if (i == 0) {
return;
}
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> iterator = keys.iterator();
while (iterator.hasNext()) {
SelectionKey key = iterator.next();
if (key.isWritable()) { // check if can write data
sendBuff.clear();
sendBuff.put(name.getBytes());
sendBuff.flip();
client.write(sendBuff);
client.register(selector, SelectionKey.OP_READ);
} else if (key.isReadable()) { // check if can read data
receiveBuff.clear();
int len = client.read(receiveBuff);
if (len > 0) {
String msg = new String(receiveBuff.array(), 0, len);
System.out.println("Receive message from server: " + msg);
client.register(selector, SelectionKey.OP_WRITE);
unFinish = false;
}
}
iterator.remove();
}
}
}
public static void main(String[] args) throws IOException {
new NioClient().session();
}
}
| 2,373 | 0.683102 | 0.67678 | 95 | 23.978947 | 19.752138 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.621053 | false | false | 0 |
161a6258ce102105d47eebd45b23ca61de4296e0 | 13,529,147,034,745 | f10001f42c62da8c6c1b5043b95af200216e33ea | /app/src/main/java/com/blackout/paidupdater/News/NewsAdapter.java | dbf98227539864f05424c821bf7bfbf5e5e594ae | []
| no_license | MSF-Jarvis/TeamBlackOut | https://github.com/MSF-Jarvis/TeamBlackOut | 9fef558724f598d6ad17af3b96af628d7da7598f | d7656ea3130b3d2b9e5d00060deb370ffee1f1d6 | refs/heads/master | 2017-02-23T15:18:24.859000 | 2017-01-30T08:19:36 | 2017-01-30T08:19:36 | 80,403,982 | 0 | 0 | null | true | 2017-01-30T08:19:42 | 2017-01-30T08:19:42 | 2017-01-19T02:40:33 | 2016-06-21T21:55:14 | 8,626 | 0 | 0 | 0 | null | null | null | package com.blackout.paidupdater.News;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.blackout.paidupdater.R;
import java.util.ArrayList;
public class NewsAdapter extends ArrayAdapter<News> {
Context context;
int layoutResourceId;
private ArrayList<News> data;
public NewsAdapter(Context context, int layoutResourceId, ArrayList<News> data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.context = context;
this.data = data;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
AppHolder holder = null;
if(row == null)
{
LayoutInflater inflater = ((Activity)context).getLayoutInflater();
row = inflater.inflate(R.layout.list_header_date, parent, false);
holder = new AppHolder();
holder.txtTitle = (TextView) row.findViewById(R.id.headerView);
holder.txtDate = (TextView) row.findViewById(R.id.dateView);
row.setTag(holder);
}
else
{
holder = (AppHolder)row.getTag();
}
holder.txtTitle.setText(data.get(position).title);
holder.txtDate.setText(data.get(position).date);
return row;
}
static class AppHolder
{
TextView txtTitle;
TextView txtDate;
}
} | UTF-8 | Java | 1,610 | java | NewsAdapter.java | Java | []
| null | []
| package com.blackout.paidupdater.News;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.blackout.paidupdater.R;
import java.util.ArrayList;
public class NewsAdapter extends ArrayAdapter<News> {
Context context;
int layoutResourceId;
private ArrayList<News> data;
public NewsAdapter(Context context, int layoutResourceId, ArrayList<News> data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.context = context;
this.data = data;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
AppHolder holder = null;
if(row == null)
{
LayoutInflater inflater = ((Activity)context).getLayoutInflater();
row = inflater.inflate(R.layout.list_header_date, parent, false);
holder = new AppHolder();
holder.txtTitle = (TextView) row.findViewById(R.id.headerView);
holder.txtDate = (TextView) row.findViewById(R.id.dateView);
row.setTag(holder);
}
else
{
holder = (AppHolder)row.getTag();
}
holder.txtTitle.setText(data.get(position).title);
holder.txtDate.setText(data.get(position).date);
return row;
}
static class AppHolder
{
TextView txtTitle;
TextView txtDate;
}
} | 1,610 | 0.654037 | 0.654037 | 61 | 25.409836 | 23.56044 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.639344 | false | false | 0 |
4c94c4867a3767344a71f7bccc7034e83c2b9114 | 1,013,612,330,589 | 9f1f0a06e6e6eefd4173eb4031b69b8b949f56e1 | /project/src/main/java/com/esiea/tetris/model/concrete/console/command/HighScoresCommand.java | 2620dbb297718f832749aa9eaa725a6d27863db5 | []
| no_license | b2800/tmpl | https://github.com/b2800/tmpl | 07823c03d0e4666f961591f5ec6d5e14536cfa66 | 514dd64881d9dfc20d87e2b47ed1369ab30ab10d | refs/heads/master | 2021-01-10T14:03:36.598000 | 2016-04-14T17:38:10 | 2016-04-14T17:38:10 | 53,425,819 | 0 | 0 | null | false | 2016-03-22T13:14:18 | 2016-03-08T16:06:22 | 2016-03-14T13:33:50 | 2016-03-22T13:14:18 | 53 | 0 | 0 | 11 | Java | null | null | package com.esiea.tetris.model.concrete.console.command;
import com.esiea.tetris.utils.ScoreUtil;
public class HighScoresCommand implements Command{
@Override
public String execute(String[] args) {
StringBuilder builder = new StringBuilder();
builder.append("Meilleurs scores : \n");
for(int score : ScoreUtil.getHighScores()){
builder.append(Integer.toString(score));
builder.append("\n");
}
return builder.toString();
}
@Override
public String getName() {
return "scores";
}
}
| UTF-8 | Java | 579 | java | HighScoresCommand.java | Java | []
| null | []
| package com.esiea.tetris.model.concrete.console.command;
import com.esiea.tetris.utils.ScoreUtil;
public class HighScoresCommand implements Command{
@Override
public String execute(String[] args) {
StringBuilder builder = new StringBuilder();
builder.append("Meilleurs scores : \n");
for(int score : ScoreUtil.getHighScores()){
builder.append(Integer.toString(score));
builder.append("\n");
}
return builder.toString();
}
@Override
public String getName() {
return "scores";
}
}
| 579 | 0.637306 | 0.637306 | 22 | 25.318182 | 20.607559 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false | 0 |
20e343df547ec5c3e093637efaf004d636cd1f70 | 19,318,762,898,363 | 1d32cf7ea464c30d6a6e35e1f21659d0e07bd482 | /src/main/java/com/cris/Servicio/DataBaseServices.java | 535aafa5b3096ee00472b58dc77d5c68be19e588 | []
| no_license | CristianGuillen/P3WEB | https://github.com/CristianGuillen/P3WEB | ba57b7add5d8ab238af340b6f632515d6dd2b866 | 069d4a76ac99dff62a57254d37617aa50d1b3d0f | refs/heads/master | 2020-09-21T17:44:58.277000 | 2019-11-29T14:41:33 | 2019-11-29T14:41:33 | 224,870,994 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cris.Servicio;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class DataBaseServices {
private static DataBaseServices blogDBInstancia;
private String URL = "jdbc:h2:~/Blog";
private DataBaseServices(){
registrarDriver();
}
private void registrarDriver() {
try {
Class.forName("org.h2.Driver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(DataBaseServices.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Retornando la instancia.
* @return
*/
public static DataBaseServices getInstancia(){
if(blogDBInstancia==null){
blogDBInstancia = new DataBaseServices();
}
return blogDBInstancia;
}
public Connection getConexion() {
Connection con = null;
try {
con = DriverManager.getConnection(URL, "sa", "");
} catch (SQLException ex) {
Logger.getLogger(DataBaseServices.class.getName()).log(Level.SEVERE, null, ex);
}
return con;
}
public void testConexion() {
getConexion();
System.out.println("Conexion exitosa!...");
}
}
| UTF-8 | Java | 1,309 | java | DataBaseServices.java | Java | []
| null | []
| package com.cris.Servicio;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class DataBaseServices {
private static DataBaseServices blogDBInstancia;
private String URL = "jdbc:h2:~/Blog";
private DataBaseServices(){
registrarDriver();
}
private void registrarDriver() {
try {
Class.forName("org.h2.Driver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(DataBaseServices.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Retornando la instancia.
* @return
*/
public static DataBaseServices getInstancia(){
if(blogDBInstancia==null){
blogDBInstancia = new DataBaseServices();
}
return blogDBInstancia;
}
public Connection getConexion() {
Connection con = null;
try {
con = DriverManager.getConnection(URL, "sa", "");
} catch (SQLException ex) {
Logger.getLogger(DataBaseServices.class.getName()).log(Level.SEVERE, null, ex);
}
return con;
}
public void testConexion() {
getConexion();
System.out.println("Conexion exitosa!...");
}
}
| 1,309 | 0.616501 | 0.614973 | 52 | 24.173077 | 21.785423 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.480769 | false | false | 0 |
081e739aa81900631945cb7b451c49aaa1013c1e | 29,463,475,697,676 | 8522d5e93fe8677b8d52bb29ab4d2e8332de817a | /api/generated-src/java/com/luckygames/wmxz/gamemaster/dao/PropFlowEntityExample.java | c6919d9f9f21318921fcdf8632d6266b6ef3304b | []
| no_license | aping-fo/gm | https://github.com/aping-fo/gm | 1f0b7195069bc13fa324df5f9c42901811f9e3e8 | 5a8e54a782481d27f812da08229e847f6b5da7df | refs/heads/master | 2020-03-22T12:27:30.982000 | 2018-07-07T00:46:53 | 2018-07-07T00:46:53 | 140,041,429 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.luckygames.wmxz.gamemaster.dao;
import com.luckygames.wmxz.gamemaster.model.enums.Status;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PropFlowEntityExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PropFlowEntityExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Status value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Status value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Status value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Status value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Status value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Status value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Status> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Status> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Status value1, Status value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Status value1, Status value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andServerIdIsNull() {
addCriterion("server_id is null");
return (Criteria) this;
}
public Criteria andServerIdIsNotNull() {
addCriterion("server_id is not null");
return (Criteria) this;
}
public Criteria andServerIdEqualTo(Long value) {
addCriterion("server_id =", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdNotEqualTo(Long value) {
addCriterion("server_id <>", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdGreaterThan(Long value) {
addCriterion("server_id >", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdGreaterThanOrEqualTo(Long value) {
addCriterion("server_id >=", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdLessThan(Long value) {
addCriterion("server_id <", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdLessThanOrEqualTo(Long value) {
addCriterion("server_id <=", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdIn(List<Long> values) {
addCriterion("server_id in", values, "serverId");
return (Criteria) this;
}
public Criteria andServerIdNotIn(List<Long> values) {
addCriterion("server_id not in", values, "serverId");
return (Criteria) this;
}
public Criteria andServerIdBetween(Long value1, Long value2) {
addCriterion("server_id between", value1, value2, "serverId");
return (Criteria) this;
}
public Criteria andServerIdNotBetween(Long value1, Long value2) {
addCriterion("server_id not between", value1, value2, "serverId");
return (Criteria) this;
}
public Criteria andServerNameIsNull() {
addCriterion("`server_name` is null");
return (Criteria) this;
}
public Criteria andServerNameIsNotNull() {
addCriterion("`server_name` is not null");
return (Criteria) this;
}
public Criteria andServerNameEqualTo(String value) {
addCriterion("`server_name` =", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotEqualTo(String value) {
addCriterion("`server_name` <>", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameGreaterThan(String value) {
addCriterion("`server_name` >", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameGreaterThanOrEqualTo(String value) {
addCriterion("`server_name` >=", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameLessThan(String value) {
addCriterion("`server_name` <", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameLessThanOrEqualTo(String value) {
addCriterion("`server_name` <=", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameLike(String value) {
addCriterion("`server_name` like", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotLike(String value) {
addCriterion("`server_name` not like", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameIn(List<String> values) {
addCriterion("`server_name` in", values, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotIn(List<String> values) {
addCriterion("`server_name` not in", values, "serverName");
return (Criteria) this;
}
public Criteria andServerNameBetween(String value1, String value2) {
addCriterion("`server_name` between", value1, value2, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotBetween(String value1, String value2) {
addCriterion("`server_name` not between", value1, value2, "serverName");
return (Criteria) this;
}
public Criteria andChannelIdIsNull() {
addCriterion("channel_id is null");
return (Criteria) this;
}
public Criteria andChannelIdIsNotNull() {
addCriterion("channel_id is not null");
return (Criteria) this;
}
public Criteria andChannelIdEqualTo(Long value) {
addCriterion("channel_id =", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdNotEqualTo(Long value) {
addCriterion("channel_id <>", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdGreaterThan(Long value) {
addCriterion("channel_id >", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdGreaterThanOrEqualTo(Long value) {
addCriterion("channel_id >=", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdLessThan(Long value) {
addCriterion("channel_id <", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdLessThanOrEqualTo(Long value) {
addCriterion("channel_id <=", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdIn(List<Long> values) {
addCriterion("channel_id in", values, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdNotIn(List<Long> values) {
addCriterion("channel_id not in", values, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdBetween(Long value1, Long value2) {
addCriterion("channel_id between", value1, value2, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdNotBetween(Long value1, Long value2) {
addCriterion("channel_id not between", value1, value2, "channelId");
return (Criteria) this;
}
public Criteria andChannelNameIsNull() {
addCriterion("channel_name is null");
return (Criteria) this;
}
public Criteria andChannelNameIsNotNull() {
addCriterion("channel_name is not null");
return (Criteria) this;
}
public Criteria andChannelNameEqualTo(String value) {
addCriterion("channel_name =", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotEqualTo(String value) {
addCriterion("channel_name <>", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameGreaterThan(String value) {
addCriterion("channel_name >", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameGreaterThanOrEqualTo(String value) {
addCriterion("channel_name >=", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameLessThan(String value) {
addCriterion("channel_name <", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameLessThanOrEqualTo(String value) {
addCriterion("channel_name <=", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameLike(String value) {
addCriterion("channel_name like", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotLike(String value) {
addCriterion("channel_name not like", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameIn(List<String> values) {
addCriterion("channel_name in", values, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotIn(List<String> values) {
addCriterion("channel_name not in", values, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameBetween(String value1, String value2) {
addCriterion("channel_name between", value1, value2, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotBetween(String value1, String value2) {
addCriterion("channel_name not between", value1, value2, "channelName");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andCountIsNull() {
addCriterion("`count` is null");
return (Criteria) this;
}
public Criteria andCountIsNotNull() {
addCriterion("`count` is not null");
return (Criteria) this;
}
public Criteria andCountEqualTo(Integer value) {
addCriterion("`count` =", value, "count");
return (Criteria) this;
}
public Criteria andCountNotEqualTo(Integer value) {
addCriterion("`count` <>", value, "count");
return (Criteria) this;
}
public Criteria andCountGreaterThan(Integer value) {
addCriterion("`count` >", value, "count");
return (Criteria) this;
}
public Criteria andCountGreaterThanOrEqualTo(Integer value) {
addCriterion("`count` >=", value, "count");
return (Criteria) this;
}
public Criteria andCountLessThan(Integer value) {
addCriterion("`count` <", value, "count");
return (Criteria) this;
}
public Criteria andCountLessThanOrEqualTo(Integer value) {
addCriterion("`count` <=", value, "count");
return (Criteria) this;
}
public Criteria andCountIn(List<Integer> values) {
addCriterion("`count` in", values, "count");
return (Criteria) this;
}
public Criteria andCountNotIn(List<Integer> values) {
addCriterion("`count` not in", values, "count");
return (Criteria) this;
}
public Criteria andCountBetween(Integer value1, Integer value2) {
addCriterion("`count` between", value1, value2, "count");
return (Criteria) this;
}
public Criteria andCountNotBetween(Integer value1, Integer value2) {
addCriterion("`count` not between", value1, value2, "count");
return (Criteria) this;
}
public Criteria andStrengtheningGradeIsNull() {
addCriterion("strengthening_grade is null");
return (Criteria) this;
}
public Criteria andStrengtheningGradeIsNotNull() {
addCriterion("strengthening_grade is not null");
return (Criteria) this;
}
public Criteria andStrengtheningGradeEqualTo(Integer value) {
addCriterion("strengthening_grade =", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeNotEqualTo(Integer value) {
addCriterion("strengthening_grade <>", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeGreaterThan(Integer value) {
addCriterion("strengthening_grade >", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeGreaterThanOrEqualTo(Integer value) {
addCriterion("strengthening_grade >=", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeLessThan(Integer value) {
addCriterion("strengthening_grade <", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeLessThanOrEqualTo(Integer value) {
addCriterion("strengthening_grade <=", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeIn(List<Integer> values) {
addCriterion("strengthening_grade in", values, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeNotIn(List<Integer> values) {
addCriterion("strengthening_grade not in", values, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeBetween(Integer value1, Integer value2) {
addCriterion("strengthening_grade between", value1, value2, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeNotBetween(Integer value1, Integer value2) {
addCriterion("strengthening_grade not between", value1, value2, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionIsNull() {
addCriterion("strengthening_degree_completion is null");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionIsNotNull() {
addCriterion("strengthening_degree_completion is not null");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion =", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionNotEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion <>", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionGreaterThan(BigDecimal value) {
addCriterion("strengthening_degree_completion >", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion >=", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionLessThan(BigDecimal value) {
addCriterion("strengthening_degree_completion <", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionLessThanOrEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion <=", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionIn(List<BigDecimal> values) {
addCriterion("strengthening_degree_completion in", values, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionNotIn(List<BigDecimal> values) {
addCriterion("strengthening_degree_completion not in", values, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("strengthening_degree_completion between", value1, value2, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("strengthening_degree_completion not between", value1, value2, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andLuckyValueIsNull() {
addCriterion("lucky_value is null");
return (Criteria) this;
}
public Criteria andLuckyValueIsNotNull() {
addCriterion("lucky_value is not null");
return (Criteria) this;
}
public Criteria andLuckyValueEqualTo(Integer value) {
addCriterion("lucky_value =", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueNotEqualTo(Integer value) {
addCriterion("lucky_value <>", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueGreaterThan(Integer value) {
addCriterion("lucky_value >", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueGreaterThanOrEqualTo(Integer value) {
addCriterion("lucky_value >=", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueLessThan(Integer value) {
addCriterion("lucky_value <", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueLessThanOrEqualTo(Integer value) {
addCriterion("lucky_value <=", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueIn(List<Integer> values) {
addCriterion("lucky_value in", values, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueNotIn(List<Integer> values) {
addCriterion("lucky_value not in", values, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueBetween(Integer value1, Integer value2) {
addCriterion("lucky_value between", value1, value2, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueNotBetween(Integer value1, Integer value2) {
addCriterion("lucky_value not between", value1, value2, "luckyValue");
return (Criteria) this;
}
public Criteria andSetIsNull() {
addCriterion("`set` is null");
return (Criteria) this;
}
public Criteria andSetIsNotNull() {
addCriterion("`set` is not null");
return (Criteria) this;
}
public Criteria andSetEqualTo(String value) {
addCriterion("`set` =", value, "set");
return (Criteria) this;
}
public Criteria andSetNotEqualTo(String value) {
addCriterion("`set` <>", value, "set");
return (Criteria) this;
}
public Criteria andSetGreaterThan(String value) {
addCriterion("`set` >", value, "set");
return (Criteria) this;
}
public Criteria andSetGreaterThanOrEqualTo(String value) {
addCriterion("`set` >=", value, "set");
return (Criteria) this;
}
public Criteria andSetLessThan(String value) {
addCriterion("`set` <", value, "set");
return (Criteria) this;
}
public Criteria andSetLessThanOrEqualTo(String value) {
addCriterion("`set` <=", value, "set");
return (Criteria) this;
}
public Criteria andSetLike(String value) {
addCriterion("`set` like", value, "set");
return (Criteria) this;
}
public Criteria andSetNotLike(String value) {
addCriterion("`set` not like", value, "set");
return (Criteria) this;
}
public Criteria andSetIn(List<String> values) {
addCriterion("`set` in", values, "set");
return (Criteria) this;
}
public Criteria andSetNotIn(List<String> values) {
addCriterion("`set` not in", values, "set");
return (Criteria) this;
}
public Criteria andSetBetween(String value1, String value2) {
addCriterion("`set` between", value1, value2, "set");
return (Criteria) this;
}
public Criteria andSetNotBetween(String value1, String value2) {
addCriterion("`set` not between", value1, value2, "set");
return (Criteria) this;
}
public Criteria andClearIsNull() {
addCriterion("clear is null");
return (Criteria) this;
}
public Criteria andClearIsNotNull() {
addCriterion("clear is not null");
return (Criteria) this;
}
public Criteria andClearEqualTo(String value) {
addCriterion("clear =", value, "clear");
return (Criteria) this;
}
public Criteria andClearNotEqualTo(String value) {
addCriterion("clear <>", value, "clear");
return (Criteria) this;
}
public Criteria andClearGreaterThan(String value) {
addCriterion("clear >", value, "clear");
return (Criteria) this;
}
public Criteria andClearGreaterThanOrEqualTo(String value) {
addCriterion("clear >=", value, "clear");
return (Criteria) this;
}
public Criteria andClearLessThan(String value) {
addCriterion("clear <", value, "clear");
return (Criteria) this;
}
public Criteria andClearLessThanOrEqualTo(String value) {
addCriterion("clear <=", value, "clear");
return (Criteria) this;
}
public Criteria andClearLike(String value) {
addCriterion("clear like", value, "clear");
return (Criteria) this;
}
public Criteria andClearNotLike(String value) {
addCriterion("clear not like", value, "clear");
return (Criteria) this;
}
public Criteria andClearIn(List<String> values) {
addCriterion("clear in", values, "clear");
return (Criteria) this;
}
public Criteria andClearNotIn(List<String> values) {
addCriterion("clear not in", values, "clear");
return (Criteria) this;
}
public Criteria andClearBetween(String value1, String value2) {
addCriterion("clear between", value1, value2, "clear");
return (Criteria) this;
}
public Criteria andClearNotBetween(String value1, String value2) {
addCriterion("clear not between", value1, value2, "clear");
return (Criteria) this;
}
public Criteria andUltimateAttributeIsNull() {
addCriterion("ultimate_attribute is null");
return (Criteria) this;
}
public Criteria andUltimateAttributeIsNotNull() {
addCriterion("ultimate_attribute is not null");
return (Criteria) this;
}
public Criteria andUltimateAttributeEqualTo(String value) {
addCriterion("ultimate_attribute =", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotEqualTo(String value) {
addCriterion("ultimate_attribute <>", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeGreaterThan(String value) {
addCriterion("ultimate_attribute >", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeGreaterThanOrEqualTo(String value) {
addCriterion("ultimate_attribute >=", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeLessThan(String value) {
addCriterion("ultimate_attribute <", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeLessThanOrEqualTo(String value) {
addCriterion("ultimate_attribute <=", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeLike(String value) {
addCriterion("ultimate_attribute like", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotLike(String value) {
addCriterion("ultimate_attribute not like", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeIn(List<String> values) {
addCriterion("ultimate_attribute in", values, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotIn(List<String> values) {
addCriterion("ultimate_attribute not in", values, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeBetween(String value1, String value2) {
addCriterion("ultimate_attribute between", value1, value2, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotBetween(String value1, String value2) {
addCriterion("ultimate_attribute not between", value1, value2, "ultimateAttribute");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | UTF-8 | Java | 43,284 | java | PropFlowEntityExample.java | Java | []
| null | []
| package com.luckygames.wmxz.gamemaster.dao;
import com.luckygames.wmxz.gamemaster.model.enums.Status;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PropFlowEntityExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PropFlowEntityExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Status value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Status value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Status value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Status value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Status value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Status value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Status> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Status> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Status value1, Status value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Status value1, Status value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andServerIdIsNull() {
addCriterion("server_id is null");
return (Criteria) this;
}
public Criteria andServerIdIsNotNull() {
addCriterion("server_id is not null");
return (Criteria) this;
}
public Criteria andServerIdEqualTo(Long value) {
addCriterion("server_id =", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdNotEqualTo(Long value) {
addCriterion("server_id <>", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdGreaterThan(Long value) {
addCriterion("server_id >", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdGreaterThanOrEqualTo(Long value) {
addCriterion("server_id >=", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdLessThan(Long value) {
addCriterion("server_id <", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdLessThanOrEqualTo(Long value) {
addCriterion("server_id <=", value, "serverId");
return (Criteria) this;
}
public Criteria andServerIdIn(List<Long> values) {
addCriterion("server_id in", values, "serverId");
return (Criteria) this;
}
public Criteria andServerIdNotIn(List<Long> values) {
addCriterion("server_id not in", values, "serverId");
return (Criteria) this;
}
public Criteria andServerIdBetween(Long value1, Long value2) {
addCriterion("server_id between", value1, value2, "serverId");
return (Criteria) this;
}
public Criteria andServerIdNotBetween(Long value1, Long value2) {
addCriterion("server_id not between", value1, value2, "serverId");
return (Criteria) this;
}
public Criteria andServerNameIsNull() {
addCriterion("`server_name` is null");
return (Criteria) this;
}
public Criteria andServerNameIsNotNull() {
addCriterion("`server_name` is not null");
return (Criteria) this;
}
public Criteria andServerNameEqualTo(String value) {
addCriterion("`server_name` =", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotEqualTo(String value) {
addCriterion("`server_name` <>", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameGreaterThan(String value) {
addCriterion("`server_name` >", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameGreaterThanOrEqualTo(String value) {
addCriterion("`server_name` >=", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameLessThan(String value) {
addCriterion("`server_name` <", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameLessThanOrEqualTo(String value) {
addCriterion("`server_name` <=", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameLike(String value) {
addCriterion("`server_name` like", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotLike(String value) {
addCriterion("`server_name` not like", value, "serverName");
return (Criteria) this;
}
public Criteria andServerNameIn(List<String> values) {
addCriterion("`server_name` in", values, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotIn(List<String> values) {
addCriterion("`server_name` not in", values, "serverName");
return (Criteria) this;
}
public Criteria andServerNameBetween(String value1, String value2) {
addCriterion("`server_name` between", value1, value2, "serverName");
return (Criteria) this;
}
public Criteria andServerNameNotBetween(String value1, String value2) {
addCriterion("`server_name` not between", value1, value2, "serverName");
return (Criteria) this;
}
public Criteria andChannelIdIsNull() {
addCriterion("channel_id is null");
return (Criteria) this;
}
public Criteria andChannelIdIsNotNull() {
addCriterion("channel_id is not null");
return (Criteria) this;
}
public Criteria andChannelIdEqualTo(Long value) {
addCriterion("channel_id =", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdNotEqualTo(Long value) {
addCriterion("channel_id <>", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdGreaterThan(Long value) {
addCriterion("channel_id >", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdGreaterThanOrEqualTo(Long value) {
addCriterion("channel_id >=", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdLessThan(Long value) {
addCriterion("channel_id <", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdLessThanOrEqualTo(Long value) {
addCriterion("channel_id <=", value, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdIn(List<Long> values) {
addCriterion("channel_id in", values, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdNotIn(List<Long> values) {
addCriterion("channel_id not in", values, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdBetween(Long value1, Long value2) {
addCriterion("channel_id between", value1, value2, "channelId");
return (Criteria) this;
}
public Criteria andChannelIdNotBetween(Long value1, Long value2) {
addCriterion("channel_id not between", value1, value2, "channelId");
return (Criteria) this;
}
public Criteria andChannelNameIsNull() {
addCriterion("channel_name is null");
return (Criteria) this;
}
public Criteria andChannelNameIsNotNull() {
addCriterion("channel_name is not null");
return (Criteria) this;
}
public Criteria andChannelNameEqualTo(String value) {
addCriterion("channel_name =", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotEqualTo(String value) {
addCriterion("channel_name <>", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameGreaterThan(String value) {
addCriterion("channel_name >", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameGreaterThanOrEqualTo(String value) {
addCriterion("channel_name >=", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameLessThan(String value) {
addCriterion("channel_name <", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameLessThanOrEqualTo(String value) {
addCriterion("channel_name <=", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameLike(String value) {
addCriterion("channel_name like", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotLike(String value) {
addCriterion("channel_name not like", value, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameIn(List<String> values) {
addCriterion("channel_name in", values, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotIn(List<String> values) {
addCriterion("channel_name not in", values, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameBetween(String value1, String value2) {
addCriterion("channel_name between", value1, value2, "channelName");
return (Criteria) this;
}
public Criteria andChannelNameNotBetween(String value1, String value2) {
addCriterion("channel_name not between", value1, value2, "channelName");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andCountIsNull() {
addCriterion("`count` is null");
return (Criteria) this;
}
public Criteria andCountIsNotNull() {
addCriterion("`count` is not null");
return (Criteria) this;
}
public Criteria andCountEqualTo(Integer value) {
addCriterion("`count` =", value, "count");
return (Criteria) this;
}
public Criteria andCountNotEqualTo(Integer value) {
addCriterion("`count` <>", value, "count");
return (Criteria) this;
}
public Criteria andCountGreaterThan(Integer value) {
addCriterion("`count` >", value, "count");
return (Criteria) this;
}
public Criteria andCountGreaterThanOrEqualTo(Integer value) {
addCriterion("`count` >=", value, "count");
return (Criteria) this;
}
public Criteria andCountLessThan(Integer value) {
addCriterion("`count` <", value, "count");
return (Criteria) this;
}
public Criteria andCountLessThanOrEqualTo(Integer value) {
addCriterion("`count` <=", value, "count");
return (Criteria) this;
}
public Criteria andCountIn(List<Integer> values) {
addCriterion("`count` in", values, "count");
return (Criteria) this;
}
public Criteria andCountNotIn(List<Integer> values) {
addCriterion("`count` not in", values, "count");
return (Criteria) this;
}
public Criteria andCountBetween(Integer value1, Integer value2) {
addCriterion("`count` between", value1, value2, "count");
return (Criteria) this;
}
public Criteria andCountNotBetween(Integer value1, Integer value2) {
addCriterion("`count` not between", value1, value2, "count");
return (Criteria) this;
}
public Criteria andStrengtheningGradeIsNull() {
addCriterion("strengthening_grade is null");
return (Criteria) this;
}
public Criteria andStrengtheningGradeIsNotNull() {
addCriterion("strengthening_grade is not null");
return (Criteria) this;
}
public Criteria andStrengtheningGradeEqualTo(Integer value) {
addCriterion("strengthening_grade =", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeNotEqualTo(Integer value) {
addCriterion("strengthening_grade <>", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeGreaterThan(Integer value) {
addCriterion("strengthening_grade >", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeGreaterThanOrEqualTo(Integer value) {
addCriterion("strengthening_grade >=", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeLessThan(Integer value) {
addCriterion("strengthening_grade <", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeLessThanOrEqualTo(Integer value) {
addCriterion("strengthening_grade <=", value, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeIn(List<Integer> values) {
addCriterion("strengthening_grade in", values, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeNotIn(List<Integer> values) {
addCriterion("strengthening_grade not in", values, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeBetween(Integer value1, Integer value2) {
addCriterion("strengthening_grade between", value1, value2, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningGradeNotBetween(Integer value1, Integer value2) {
addCriterion("strengthening_grade not between", value1, value2, "strengtheningGrade");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionIsNull() {
addCriterion("strengthening_degree_completion is null");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionIsNotNull() {
addCriterion("strengthening_degree_completion is not null");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion =", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionNotEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion <>", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionGreaterThan(BigDecimal value) {
addCriterion("strengthening_degree_completion >", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion >=", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionLessThan(BigDecimal value) {
addCriterion("strengthening_degree_completion <", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionLessThanOrEqualTo(BigDecimal value) {
addCriterion("strengthening_degree_completion <=", value, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionIn(List<BigDecimal> values) {
addCriterion("strengthening_degree_completion in", values, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionNotIn(List<BigDecimal> values) {
addCriterion("strengthening_degree_completion not in", values, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("strengthening_degree_completion between", value1, value2, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andStrengtheningDegreeCompletionNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("strengthening_degree_completion not between", value1, value2, "strengtheningDegreeCompletion");
return (Criteria) this;
}
public Criteria andLuckyValueIsNull() {
addCriterion("lucky_value is null");
return (Criteria) this;
}
public Criteria andLuckyValueIsNotNull() {
addCriterion("lucky_value is not null");
return (Criteria) this;
}
public Criteria andLuckyValueEqualTo(Integer value) {
addCriterion("lucky_value =", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueNotEqualTo(Integer value) {
addCriterion("lucky_value <>", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueGreaterThan(Integer value) {
addCriterion("lucky_value >", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueGreaterThanOrEqualTo(Integer value) {
addCriterion("lucky_value >=", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueLessThan(Integer value) {
addCriterion("lucky_value <", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueLessThanOrEqualTo(Integer value) {
addCriterion("lucky_value <=", value, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueIn(List<Integer> values) {
addCriterion("lucky_value in", values, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueNotIn(List<Integer> values) {
addCriterion("lucky_value not in", values, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueBetween(Integer value1, Integer value2) {
addCriterion("lucky_value between", value1, value2, "luckyValue");
return (Criteria) this;
}
public Criteria andLuckyValueNotBetween(Integer value1, Integer value2) {
addCriterion("lucky_value not between", value1, value2, "luckyValue");
return (Criteria) this;
}
public Criteria andSetIsNull() {
addCriterion("`set` is null");
return (Criteria) this;
}
public Criteria andSetIsNotNull() {
addCriterion("`set` is not null");
return (Criteria) this;
}
public Criteria andSetEqualTo(String value) {
addCriterion("`set` =", value, "set");
return (Criteria) this;
}
public Criteria andSetNotEqualTo(String value) {
addCriterion("`set` <>", value, "set");
return (Criteria) this;
}
public Criteria andSetGreaterThan(String value) {
addCriterion("`set` >", value, "set");
return (Criteria) this;
}
public Criteria andSetGreaterThanOrEqualTo(String value) {
addCriterion("`set` >=", value, "set");
return (Criteria) this;
}
public Criteria andSetLessThan(String value) {
addCriterion("`set` <", value, "set");
return (Criteria) this;
}
public Criteria andSetLessThanOrEqualTo(String value) {
addCriterion("`set` <=", value, "set");
return (Criteria) this;
}
public Criteria andSetLike(String value) {
addCriterion("`set` like", value, "set");
return (Criteria) this;
}
public Criteria andSetNotLike(String value) {
addCriterion("`set` not like", value, "set");
return (Criteria) this;
}
public Criteria andSetIn(List<String> values) {
addCriterion("`set` in", values, "set");
return (Criteria) this;
}
public Criteria andSetNotIn(List<String> values) {
addCriterion("`set` not in", values, "set");
return (Criteria) this;
}
public Criteria andSetBetween(String value1, String value2) {
addCriterion("`set` between", value1, value2, "set");
return (Criteria) this;
}
public Criteria andSetNotBetween(String value1, String value2) {
addCriterion("`set` not between", value1, value2, "set");
return (Criteria) this;
}
public Criteria andClearIsNull() {
addCriterion("clear is null");
return (Criteria) this;
}
public Criteria andClearIsNotNull() {
addCriterion("clear is not null");
return (Criteria) this;
}
public Criteria andClearEqualTo(String value) {
addCriterion("clear =", value, "clear");
return (Criteria) this;
}
public Criteria andClearNotEqualTo(String value) {
addCriterion("clear <>", value, "clear");
return (Criteria) this;
}
public Criteria andClearGreaterThan(String value) {
addCriterion("clear >", value, "clear");
return (Criteria) this;
}
public Criteria andClearGreaterThanOrEqualTo(String value) {
addCriterion("clear >=", value, "clear");
return (Criteria) this;
}
public Criteria andClearLessThan(String value) {
addCriterion("clear <", value, "clear");
return (Criteria) this;
}
public Criteria andClearLessThanOrEqualTo(String value) {
addCriterion("clear <=", value, "clear");
return (Criteria) this;
}
public Criteria andClearLike(String value) {
addCriterion("clear like", value, "clear");
return (Criteria) this;
}
public Criteria andClearNotLike(String value) {
addCriterion("clear not like", value, "clear");
return (Criteria) this;
}
public Criteria andClearIn(List<String> values) {
addCriterion("clear in", values, "clear");
return (Criteria) this;
}
public Criteria andClearNotIn(List<String> values) {
addCriterion("clear not in", values, "clear");
return (Criteria) this;
}
public Criteria andClearBetween(String value1, String value2) {
addCriterion("clear between", value1, value2, "clear");
return (Criteria) this;
}
public Criteria andClearNotBetween(String value1, String value2) {
addCriterion("clear not between", value1, value2, "clear");
return (Criteria) this;
}
public Criteria andUltimateAttributeIsNull() {
addCriterion("ultimate_attribute is null");
return (Criteria) this;
}
public Criteria andUltimateAttributeIsNotNull() {
addCriterion("ultimate_attribute is not null");
return (Criteria) this;
}
public Criteria andUltimateAttributeEqualTo(String value) {
addCriterion("ultimate_attribute =", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotEqualTo(String value) {
addCriterion("ultimate_attribute <>", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeGreaterThan(String value) {
addCriterion("ultimate_attribute >", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeGreaterThanOrEqualTo(String value) {
addCriterion("ultimate_attribute >=", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeLessThan(String value) {
addCriterion("ultimate_attribute <", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeLessThanOrEqualTo(String value) {
addCriterion("ultimate_attribute <=", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeLike(String value) {
addCriterion("ultimate_attribute like", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotLike(String value) {
addCriterion("ultimate_attribute not like", value, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeIn(List<String> values) {
addCriterion("ultimate_attribute in", values, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotIn(List<String> values) {
addCriterion("ultimate_attribute not in", values, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeBetween(String value1, String value2) {
addCriterion("ultimate_attribute between", value1, value2, "ultimateAttribute");
return (Criteria) this;
}
public Criteria andUltimateAttributeNotBetween(String value1, String value2) {
addCriterion("ultimate_attribute not between", value1, value2, "ultimateAttribute");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | 43,284 | 0.587284 | 0.583957 | 1,283 | 32.737335 | 27.313065 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.749026 | false | false | 0 |
e1f860ccf0e21d445229a0532d3ddcc2329bfa67 | 24,824,911,022,205 | bad52a3c6d54545923e7b57ed03e7aa17f2f735b | /src/Color.java | bb146611840de88e3a5b56dc03c8f37238c69df5 | []
| no_license | Agitik/labNumFive | https://github.com/Agitik/labNumFive | 8c07c2c40ebd6c04505fd528a5636582a676fb10 | 943bee5207ba4ad6b845fbacfa114187691f25e9 | refs/heads/master | 2022-04-24T11:16:25.706000 | 2020-04-27T17:30:49 | 2020-04-27T17:30:49 | 249,557,054 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.Scanner;
/**
* Перечесление цветов.
* @author Дмитрий Толочек P3130
* @version 1.0 Before Check
* @see Person
*/
public enum Color {
RED,
BLACK,
BLUE,
YELLOW,
WHITE,
GREEN;
/**
* Основная функция задания цвета
* @param c - цвет
* @return Color
*/
public static Color setColor(String c){
Color color = null;
switch (c.toUpperCase()){
case "RED":
color = RED;
break;
case "BLACK":
color = BLACK;
break;
case "BLUE":
color = BLUE;
break;
case "YELLOW":
color = YELLOW;
break;
case "WHITE":
color = WHITE;
break;
case "GREEN":
color = GREEN;
break;
default:
System.out.println("Такого цвета не существует.");
}
return color;
}
/**
* Функция для установки цвета с консоли (Если невозможно Null значение)
* @return Color
*/
public static Color setColorFromConsoleImNull(){
Color rt = Color.RED;
try {
System.out.println("Выберите цвет из списка: (RED, BLACK, BLUE, YELLOW, WHITE, GREEN): ");
System.out.print("Введите значение цвета: ");
Scanner in = new Scanner(System.in);
String c = in.nextLine().trim();
Color rtc = setColor(c);
if (rtc == null) {
throw new UnrealValueException("Вы ввели некорректное значение. Пересмотрите список!");
} else {rt = rtc;}
} catch (UnrealValueException e){
System.out.println("Попробуйте еще раз!");
e.getMessage();
setColorFromConsoleImNull();
}
return rt;
}
/**
* Функция для установки цвета с консоли (Если возможно Null значение)
* @return Color
*/
public static Color setColorFromConsolePNull(){
Color rt = null;
try {
System.out.println("Выберите цвет из списка: (RED, BLACK, BLUE, YELLOW, WHITE, GREEN): ");
System.out.println("Или оставьте строку пустой!");
System.out.print("Введите значение цвета: ");
Scanner in = new Scanner(System.in);
String c = in.nextLine().trim();
Color color;
switch (c.trim().toUpperCase()) {
case "":
color = null;
case "RED":
color = RED;
break;
case "BLACK":
color = BLACK;
break;
case "BLUE":
color = BLUE;
break;
case "YELLOW":
color = YELLOW;
break;
case "WHITE":
color = WHITE;
break;
case "GREEN":
color = GREEN;
break;
default:
throw new UnrealValueException("Выберите пункт из списка или оставьте строку пустой!");
}
rt = color;
} catch (UnrealValueException e){
System.out.println("Попробуйте еще раз!");
e.getMessage();
setColorFromConsolePNull();
}
return rt;
}
} | UTF-8 | Java | 3,886 | java | Color.java | Java | [
{
"context": "l.Scanner;\n\n/**\n * Перечесление цветов.\n * @author Дмитрий Толочек P3130\n * @version 1.0 Before Check\n * @see Person",
"end": 81,
"score": 0.9998681545257568,
"start": 66,
"tag": "NAME",
"value": "Дмитрий Толочек"
},
{
"context": " * Перечесление цветов.\n * @author Дмитрий Толочек P3130\n * @version 1.0 Before Check\n * @see Person\n */\np",
"end": 87,
"score": 0.9504181742668152,
"start": 82,
"tag": "USERNAME",
"value": "P3130"
}
]
| null | []
| import java.util.Scanner;
/**
* Перечесление цветов.
* @author <NAME> P3130
* @version 1.0 Before Check
* @see Person
*/
public enum Color {
RED,
BLACK,
BLUE,
YELLOW,
WHITE,
GREEN;
/**
* Основная функция задания цвета
* @param c - цвет
* @return Color
*/
public static Color setColor(String c){
Color color = null;
switch (c.toUpperCase()){
case "RED":
color = RED;
break;
case "BLACK":
color = BLACK;
break;
case "BLUE":
color = BLUE;
break;
case "YELLOW":
color = YELLOW;
break;
case "WHITE":
color = WHITE;
break;
case "GREEN":
color = GREEN;
break;
default:
System.out.println("Такого цвета не существует.");
}
return color;
}
/**
* Функция для установки цвета с консоли (Если невозможно Null значение)
* @return Color
*/
public static Color setColorFromConsoleImNull(){
Color rt = Color.RED;
try {
System.out.println("Выберите цвет из списка: (RED, BLACK, BLUE, YELLOW, WHITE, GREEN): ");
System.out.print("Введите значение цвета: ");
Scanner in = new Scanner(System.in);
String c = in.nextLine().trim();
Color rtc = setColor(c);
if (rtc == null) {
throw new UnrealValueException("Вы ввели некорректное значение. Пересмотрите список!");
} else {rt = rtc;}
} catch (UnrealValueException e){
System.out.println("Попробуйте еще раз!");
e.getMessage();
setColorFromConsoleImNull();
}
return rt;
}
/**
* Функция для установки цвета с консоли (Если возможно Null значение)
* @return Color
*/
public static Color setColorFromConsolePNull(){
Color rt = null;
try {
System.out.println("Выберите цвет из списка: (RED, BLACK, BLUE, YELLOW, WHITE, GREEN): ");
System.out.println("Или оставьте строку пустой!");
System.out.print("Введите значение цвета: ");
Scanner in = new Scanner(System.in);
String c = in.nextLine().trim();
Color color;
switch (c.trim().toUpperCase()) {
case "":
color = null;
case "RED":
color = RED;
break;
case "BLACK":
color = BLACK;
break;
case "BLUE":
color = BLUE;
break;
case "YELLOW":
color = YELLOW;
break;
case "WHITE":
color = WHITE;
break;
case "GREEN":
color = GREEN;
break;
default:
throw new UnrealValueException("Выберите пункт из списка или оставьте строку пустой!");
}
rt = color;
} catch (UnrealValueException e){
System.out.println("Попробуйте еще раз!");
e.getMessage();
setColorFromConsolePNull();
}
return rt;
}
} | 3,863 | 0.463689 | 0.46196 | 117 | 28.666666 | 20.916195 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.598291 | false | false | 0 |
a385063cb865611a968a4592b4e7c95a25bc9ce0 | 11,227,044,515,769 | 2ff610d47956d21e903e5942acbac04e009a6ba8 | /java/Spring/Dojo/src/main/java/com/codingdojo/dojo/repositories/DojoRepository.java | eba7c51e7d63b04d72aedd31e24e56e3789f8de2 | []
| no_license | SamFerr/coding-dojo-projects | https://github.com/SamFerr/coding-dojo-projects | 19d1f2f6850bd61186b448e648176e3f5cbdd168 | 95a39646ca57e5c1a12d3f33785052c9e44cfc48 | refs/heads/master | 2021-04-26T23:44:49.722000 | 2018-03-30T20:27:31 | 2018-03-30T20:27:31 | 123,848,521 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.codingdojo.dojo.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import com.codingdojo.dojo.models.DojoModel;
@Repository
public interface DojoRepository extends CrudRepository<DojoModel, Long> {
// Gets all of the dojos from the model
@Query("SELECT d FROM Dojo d")
List<DojoModel> findAll();
// Gets all of the names of all of the dojos
@Query("SELECT d.name FROM Dojo d")
List<DojoModel> findAllDojosNames();
// Gets all of the Dojos by ID (still in a list)
@Query("SELECT d FROM Dojo d WHERE id = ?1")
List<DojoModel> getDojoWhereId(Long id);
// Gets al of the Dojos by ID and returns one dojo at a time
@Query("SELECT d FROM Dojo d WHERE id = ?1")
DojoModel getSingleDojoWhereId(Long id);
// Modifying Queries
// Note the int type. It is because it returns the number of rows affected
// setting the name for one dojo
@Modifying
@Query("update Dojo d set d.name = ?1 WHERE d.id = ?2")
int setNameForOne(String name, Long id);
// setting the name for all dojos
@Modifying
@Query("update Dojo d set d.name = ?1")
int setNameForAll(String name);
// deleting just one dojo where the id is
@Modifying
@Query("delete Dojo d WHERE d.id = ?1")
int deleteOneDojo(Long id);
// Native Queries that we can write any query in raw SQL
// get all the names of the dojos with id. If we select all, we get a list of Dojo objects back.
@Query(value="SELECT * FROM dojos", nativeQuery=true)
List<DojoModel> findAllDojosNamesWithId();
// get all the names of the dojos with id. If we want to select specific column, we will get a list of Object arrays because it is no longer Dojo objects.
// Each index of the array will be the column selected respectively. Therefore 0 = id column, 1 = name column
@Query(value="SELECT id, name from dojos", nativeQuery=true)
List<Object[]> findAllDojosNamesWithId2();
// Get one Dojo
@Query(value="SELECT * FROM dojos WHERE id = ?1", nativeQuery=true)
DojoModel getDojosWhereId(Long id);
// inner join retrieving only the dojos
@Query("SELECT d FROM Dojo d JOIN d.ninjas n")
List<DojoModel> joinDojosAndNinjas();
// inner join retrieving dojos and ninjas
@Query("SELECT d, n FROM Dojo d JOIN d.ninjas n")
List<Object[]> joinDojosAndNinjas2();
}
| UTF-8 | Java | 2,457 | java | DojoRepository.java | Java | []
| null | []
| package com.codingdojo.dojo.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import com.codingdojo.dojo.models.DojoModel;
@Repository
public interface DojoRepository extends CrudRepository<DojoModel, Long> {
// Gets all of the dojos from the model
@Query("SELECT d FROM Dojo d")
List<DojoModel> findAll();
// Gets all of the names of all of the dojos
@Query("SELECT d.name FROM Dojo d")
List<DojoModel> findAllDojosNames();
// Gets all of the Dojos by ID (still in a list)
@Query("SELECT d FROM Dojo d WHERE id = ?1")
List<DojoModel> getDojoWhereId(Long id);
// Gets al of the Dojos by ID and returns one dojo at a time
@Query("SELECT d FROM Dojo d WHERE id = ?1")
DojoModel getSingleDojoWhereId(Long id);
// Modifying Queries
// Note the int type. It is because it returns the number of rows affected
// setting the name for one dojo
@Modifying
@Query("update Dojo d set d.name = ?1 WHERE d.id = ?2")
int setNameForOne(String name, Long id);
// setting the name for all dojos
@Modifying
@Query("update Dojo d set d.name = ?1")
int setNameForAll(String name);
// deleting just one dojo where the id is
@Modifying
@Query("delete Dojo d WHERE d.id = ?1")
int deleteOneDojo(Long id);
// Native Queries that we can write any query in raw SQL
// get all the names of the dojos with id. If we select all, we get a list of Dojo objects back.
@Query(value="SELECT * FROM dojos", nativeQuery=true)
List<DojoModel> findAllDojosNamesWithId();
// get all the names of the dojos with id. If we want to select specific column, we will get a list of Object arrays because it is no longer Dojo objects.
// Each index of the array will be the column selected respectively. Therefore 0 = id column, 1 = name column
@Query(value="SELECT id, name from dojos", nativeQuery=true)
List<Object[]> findAllDojosNamesWithId2();
// Get one Dojo
@Query(value="SELECT * FROM dojos WHERE id = ?1", nativeQuery=true)
DojoModel getDojosWhereId(Long id);
// inner join retrieving only the dojos
@Query("SELECT d FROM Dojo d JOIN d.ninjas n")
List<DojoModel> joinDojosAndNinjas();
// inner join retrieving dojos and ninjas
@Query("SELECT d, n FROM Dojo d JOIN d.ninjas n")
List<Object[]> joinDojosAndNinjas2();
}
| 2,457 | 0.736671 | 0.732194 | 76 | 31.328947 | 28.813551 | 154 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.197368 | false | false | 0 |
169111eabc1fc94fb3605823a68e7ab9748cec34 | 29,429,115,964,467 | bf46c838d1a41af499d2c927a6dc7a41ac6ef6f0 | /CarRentalManagementGUI/src/cz/muni/fi/pv168/RentsTableModel.java | e19acc5c3ecf4603d97292db76edadf367f294eb | []
| no_license | GeorgeKolcak/PV168-Projekt | https://github.com/GeorgeKolcak/PV168-Projekt | 231bdbef3722b60c6c96be2a547bd4206aa76731 | 7a1aa479f6b396d393f6ebf54a084e41ad8f5c3a | refs/heads/master | 2021-01-18T20:29:50.957000 | 2012-06-07T08:08:26 | 2012-06-07T08:08:26 | 4,287,174 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cz.muni.fi.pv168;
import java.sql.Date;
import java.util.*;
import javax.swing.table.AbstractTableModel;
public class RentsTableModel extends AbstractTableModel {
private List<Rent> rents = new ArrayList<>();
private ResourceBundle localization;
public List<Rent> getRents()
{
return Collections.unmodifiableList(rents);
}
public RentsTableModel(ResourceBundle localization)
{
this.localization = localization;
}
public boolean hasNewRents()
{
for (Rent r : rents)
if (r.getID() == null)
return true;
return false;
}
public void updateRents(List<Rent> newInventories) {
if (null == newInventories) {
return;
}
int firstRow = 0;
int lastRow = rents.size() - 1;
rents.clear();
fireTableRowsDeleted(firstRow, lastRow < 0 ? 0 : lastRow);
rents.addAll(newInventories);
Collections.sort(rents, rentByIDComparator);
lastRow = rents.size() - 1;
fireTableRowsInserted(firstRow, lastRow < 0 ? 0 : lastRow);
}
@Override
public int getRowCount() {
return rents.size();
}
@Override
public int getColumnCount() {
return 5;
}
@Override
public Class<?> getColumnClass(int columnIndex) {
switch (columnIndex) {
case 0:
case 1:
case 2:
return Long.class;
case 3:
case 4:
return Date.class;
default:
throw new IllegalArgumentException();
}
}
@Override
public String getColumnName(int column) {
switch (column) {
case 0:
return "ID";
case 1:
return (localization.getString("car") + " ID");
case 2:
return (localization.getString("customer") + " ID");
case 3:
return localization.getString("rent_date");
case 4:
return localization.getString("due_date");
default:
throw new IllegalArgumentException("Column");
}
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (rowIndex >= rents.size()) {
throw new IllegalArgumentException("Row Index Out Of Bounds.");
}
Rent rent = rents.get(rowIndex);
switch (columnIndex) {
case 0:
return rent.getID();
case 1:
return rent.getCarID();
case 2:
return rent.getCustomerID();
case 3:
return rent.getRentDate();
case 4:
return rent.getDueDate();
default:
throw new IllegalArgumentException("Column Index");
}
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if (rowIndex >= rents.size()) {
throw new IllegalArgumentException("Row Index Out Of Bounds.");
}
Rent rent = rents.get(rowIndex);
switch (columnIndex) {
case 1:
rent.setCarID((Long) aValue);
break;
case 2:
rent.setCustomerID((Long) aValue);
break;
case 3:
rent.setRentDate((Date) aValue);
break;
case 4:
rent.setDueDate((Date) aValue);
break;
default:
throw new IllegalArgumentException("Column Index");
}
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return false;
}
private static Comparator<Rent> rentByIDComparator = new Comparator<Rent>() {
@Override
public int compare(Rent rent1, Rent rent2) {
return Long.valueOf(rent1.getID()).compareTo(Long.valueOf(rent2.getID()));
}
};
public void add(Rent rent)
{
rents.add(rent);
fireTableRowsInserted((rents.size() - 1), rents.size());
}
}
| UTF-8 | Java | 4,180 | java | RentsTableModel.java | Java | []
| null | []
| package cz.muni.fi.pv168;
import java.sql.Date;
import java.util.*;
import javax.swing.table.AbstractTableModel;
public class RentsTableModel extends AbstractTableModel {
private List<Rent> rents = new ArrayList<>();
private ResourceBundle localization;
public List<Rent> getRents()
{
return Collections.unmodifiableList(rents);
}
public RentsTableModel(ResourceBundle localization)
{
this.localization = localization;
}
public boolean hasNewRents()
{
for (Rent r : rents)
if (r.getID() == null)
return true;
return false;
}
public void updateRents(List<Rent> newInventories) {
if (null == newInventories) {
return;
}
int firstRow = 0;
int lastRow = rents.size() - 1;
rents.clear();
fireTableRowsDeleted(firstRow, lastRow < 0 ? 0 : lastRow);
rents.addAll(newInventories);
Collections.sort(rents, rentByIDComparator);
lastRow = rents.size() - 1;
fireTableRowsInserted(firstRow, lastRow < 0 ? 0 : lastRow);
}
@Override
public int getRowCount() {
return rents.size();
}
@Override
public int getColumnCount() {
return 5;
}
@Override
public Class<?> getColumnClass(int columnIndex) {
switch (columnIndex) {
case 0:
case 1:
case 2:
return Long.class;
case 3:
case 4:
return Date.class;
default:
throw new IllegalArgumentException();
}
}
@Override
public String getColumnName(int column) {
switch (column) {
case 0:
return "ID";
case 1:
return (localization.getString("car") + " ID");
case 2:
return (localization.getString("customer") + " ID");
case 3:
return localization.getString("rent_date");
case 4:
return localization.getString("due_date");
default:
throw new IllegalArgumentException("Column");
}
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (rowIndex >= rents.size()) {
throw new IllegalArgumentException("Row Index Out Of Bounds.");
}
Rent rent = rents.get(rowIndex);
switch (columnIndex) {
case 0:
return rent.getID();
case 1:
return rent.getCarID();
case 2:
return rent.getCustomerID();
case 3:
return rent.getRentDate();
case 4:
return rent.getDueDate();
default:
throw new IllegalArgumentException("Column Index");
}
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if (rowIndex >= rents.size()) {
throw new IllegalArgumentException("Row Index Out Of Bounds.");
}
Rent rent = rents.get(rowIndex);
switch (columnIndex) {
case 1:
rent.setCarID((Long) aValue);
break;
case 2:
rent.setCustomerID((Long) aValue);
break;
case 3:
rent.setRentDate((Date) aValue);
break;
case 4:
rent.setDueDate((Date) aValue);
break;
default:
throw new IllegalArgumentException("Column Index");
}
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return false;
}
private static Comparator<Rent> rentByIDComparator = new Comparator<Rent>() {
@Override
public int compare(Rent rent1, Rent rent2) {
return Long.valueOf(rent1.getID()).compareTo(Long.valueOf(rent2.getID()));
}
};
public void add(Rent rent)
{
rents.add(rent);
fireTableRowsInserted((rents.size() - 1), rents.size());
}
}
| 4,180 | 0.52799 | 0.519617 | 152 | 26.5 | 21.048815 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.414474 | false | false | 0 |
33c75b50e683126a9f3b540376af7fbe03f8ba80 | 11,991,548,752,329 | cdf2e28fc4c9a78456cc93cb0c7ebe7ecf17709a | /.svn/pristine/33/33c75b50e683126a9f3b540376af7fbe03f8ba80.svn-base | fc50b6b4fe280c0ed32816a9e913d2b60d5ad42e | []
| no_license | xie-summer/basicPaltfrom | https://github.com/xie-summer/basicPaltfrom | ce9f4fe19d0188f03b084640998224e4dd74f9f9 | 9425c75560356aa9397189affd6d2a9fd89caf02 | refs/heads/master | 2021-06-16T04:05:13.957000 | 2017-05-11T02:20:27 | 2017-05-11T02:23:33 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.kintiger.platform.sap.service;
import java.util.List;
/**
*
* @author xujiakun
*
*/
public interface ISAPService {
String RESULT_ERROR = "RFC操作失败!";
/**
* 根据当前用户的sap角色,更新sap临时帐号权限.
*
* @param passport
* @param roles
* @param loginId
* @param ip
* @return
* @throws SystemException
*/
String updatePermission(String passport, List<String> roles, String loginId, String ip) throws Exception;
/**
* 清空sap临时帐权限.
*
* @param passport
* @return
*/
boolean removePermission(String passport);
}
| GB18030 | Java | 605 | 33c75b50e683126a9f3b540376af7fbe03f8ba80.svn-base | Java | [
{
"context": "rvice;\n\nimport java.util.List;\n\n/**\n * \n * @author xujiakun\n * \n */\npublic interface ISAPService {\n\n\tString R",
"end": 95,
"score": 0.9995756149291992,
"start": 87,
"tag": "USERNAME",
"value": "xujiakun"
}
]
| null | []
| package com.kintiger.platform.sap.service;
import java.util.List;
/**
*
* @author xujiakun
*
*/
public interface ISAPService {
String RESULT_ERROR = "RFC操作失败!";
/**
* 根据当前用户的sap角色,更新sap临时帐号权限.
*
* @param passport
* @param roles
* @param loginId
* @param ip
* @return
* @throws SystemException
*/
String updatePermission(String passport, List<String> roles, String loginId, String ip) throws Exception;
/**
* 清空sap临时帐权限.
*
* @param passport
* @return
*/
boolean removePermission(String passport);
}
| 605 | 0.666055 | 0.666055 | 34 | 15.029411 | 20.08143 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.794118 | false | false | 0 |
|
be366578c49156a3410dcaa8058be8e6010fa40e | 31,568,009,681,045 | 0f45ab5632a31e8888bd1c8a393c496555a3269a | /app/src/main/java/com/dimelo/sampleapp/MainActivity.java | ee91eec9dcad8618a7c7cd58d2215a14058b34ea | []
| no_license | dimelo/Dimelo-Android-SampleApp | https://github.com/dimelo/Dimelo-Android-SampleApp | 294c4c8c120ed8ad143f97f2be7ad621f45253e0 | 7bff809723976e23d2e4ec237921165b6fcfd670 | refs/heads/master | 2020-05-29T11:47:48.545000 | 2020-01-20T09:56:57 | 2020-01-20T09:56:57 | 37,334,069 | 1 | 4 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.dimelo.sampleapp;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Toast;
import com.dimelo.dimelosdk.Models.UserDatas;
import com.dimelo.dimelosdk.main.Chat;
import com.dimelo.dimelosdk.main.Dimelo;
import com.dimelo.dimelosdk.main.DimeloConnection;
import com.google.firebase.iid.FirebaseInstanceId;
//import com.google.android.gms.gcm.GoogleCloudMessaging;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
public class MainActivity extends AppCompatActivity {
// private static final String SENDER_ID = BuildConfig.GCM_API_KEY; // GCM ID to be defined in gradle.properties
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
// // Get GCM Token
// registerInBackground();
// Setup Dimelo
final Dimelo dimelo = setupDimelo(this);
dimelo.setDimeloListener(dimeloListener);
FragmentManager supportFragmentManager = getSupportFragmentManager();
SlidingTabFragment mSlidingFragment = (SlidingTabFragment) supportFragmentManager.findFragmentByTag("mSlidingFragment");
if (mSlidingFragment == null) {
mSlidingFragment = new SlidingTabFragment();
mSlidingFragment.setRetainInstance(true);
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
fragmentTransaction.add(R.id.slider_container, mSlidingFragment, "mSlidingFragment");
fragmentTransaction.commit();
}
}
Dimelo.DimeloListener dimeloListener = new Dimelo.DimeloListener() {
@Override
public void onOpen(Dimelo dimelo) {
super.onOpen(dimelo);
Log.e("on open : ", "userIdentifier : " + dimelo.getUserIdentifier() + ", userName :" + dimelo.getUserName() + ", authenticationInfo :"+ dimelo.getAuthenticationInfo());
}
@Override
public void onClose(Dimelo dimelo) {
super.onClose(dimelo);
Log.e("on open : ", "userIdentifier : " + dimelo.getUserIdentifier() + ", userName :" + dimelo.getUserName() + ", authenticationInfo :"+ dimelo.getAuthenticationInfo());
}
@Override
public void dimeloChatDidSendMessage() {
JSONObject messageContextInfo = new JSONObject();
try {
messageContextInfo.put("extra", "1234");
} catch (JSONException e) {
}
Dimelo.getInstance().setMessageContextInfo(messageContextInfo);
}
@Override
public void dimeloChatMessageSendFail(DimeloConnection.DimeloError error) {
// Something went wrong
// Minimal error management
String message = "An error occurred";
if (error.statusCode == DimeloConnection.DimeloError.NO_CONNECTION_ERROR) {
message = "Please check your Internet connection and try again later.";
} else if (error.statusCode == DimeloConnection.DimeloError.TIMEOUT_ERROR) {
message = "The server is not responding, please try again later";
}
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
}
};
static Dimelo setupDimelo(Context context) {
String secret = BuildConfig.DIMELO_SDK_SECRET; //edit in gradle.properties
String domainName = BuildConfig.DIMELO_SDK_DOMAIN_NAME; //edit in gradle.properties
Dimelo.setup(context);
Dimelo dimelo = Dimelo.getInstance();
dimelo.initWithApiSecret(secret, domainName, null);
dimelo.setDebug(true);
dimelo.setUserName("John Doe");
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
if (refreshedToken != null)
dimelo.setDeviceToken(refreshedToken);
JSONObject authInfo = new JSONObject();
try {
authInfo.put("CustomerId", "0123456789");
authInfo.put("Dimelo", "Rocks!");
} catch (JSONException e) {
}
dimelo.setAuthenticationInfo(authInfo);
return dimelo;
}
@Override
public void onBackPressed() {
SlidingTabFragment mSlidingFragment = (SlidingTabFragment) getSupportFragmentManager().findFragmentByTag("mSlidingFragment");
if (mSlidingFragment != null && mSlidingFragment.isHandlingBack())
return;
super.onBackPressed();
}
// /**
// * Registers the application with GCM servers asynchronously.
// * <p/>
// * Stores the registration ID and app versionCode in the application's
// * shared preferences.
// */
// private void registerInBackground() {
// final Context mContext = getApplicationContext();
// AsyncTask<Object, Void, String> task = new AsyncTask<Object, Void, String>() {
//
// private String mGcmRegistrationId;
//
// @Override
// protected String doInBackground(Object... params) {
// String msg;
// try {
// GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(mContext);
// mGcmRegistrationId = gcm.register(SENDER_ID);
// msg = "Device registered, registration ID=" + mGcmRegistrationId;
// } catch (IOException ex) {
// msg = "Error :" + ex.getMessage();
// }
// return msg;
// }
//
// @Override
// protected void onPostExecute(String msg) {
// Log.d("DimeloSampleApp", msg);
// Dimelo.getInstance().setDeviceToken(mGcmRegistrationId);
// }
// };
// task.execute(null, null, null);
// }
}
| UTF-8 | Java | 6,035 | java | MainActivity.java | Java | [
{
"context": "imelo.setDebug(true);\n dimelo.setUserName(\"John Doe\");\n\n String refreshedToken = FirebaseInsta",
"end": 3953,
"score": 0.6900236010551453,
"start": 3945,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "0123456789\");\n authInfo.put(\"Dimelo\", \"Rocks!\");\n } catch (JSONException e) {\n }\n\n ",
"end": 4279,
"score": 0.9384887218475342,
"start": 4274,
"tag": "PASSWORD",
"value": "Rocks"
}
]
| null | []
| package com.dimelo.sampleapp;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Toast;
import com.dimelo.dimelosdk.Models.UserDatas;
import com.dimelo.dimelosdk.main.Chat;
import com.dimelo.dimelosdk.main.Dimelo;
import com.dimelo.dimelosdk.main.DimeloConnection;
import com.google.firebase.iid.FirebaseInstanceId;
//import com.google.android.gms.gcm.GoogleCloudMessaging;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
public class MainActivity extends AppCompatActivity {
// private static final String SENDER_ID = BuildConfig.GCM_API_KEY; // GCM ID to be defined in gradle.properties
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
// // Get GCM Token
// registerInBackground();
// Setup Dimelo
final Dimelo dimelo = setupDimelo(this);
dimelo.setDimeloListener(dimeloListener);
FragmentManager supportFragmentManager = getSupportFragmentManager();
SlidingTabFragment mSlidingFragment = (SlidingTabFragment) supportFragmentManager.findFragmentByTag("mSlidingFragment");
if (mSlidingFragment == null) {
mSlidingFragment = new SlidingTabFragment();
mSlidingFragment.setRetainInstance(true);
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
fragmentTransaction.add(R.id.slider_container, mSlidingFragment, "mSlidingFragment");
fragmentTransaction.commit();
}
}
Dimelo.DimeloListener dimeloListener = new Dimelo.DimeloListener() {
@Override
public void onOpen(Dimelo dimelo) {
super.onOpen(dimelo);
Log.e("on open : ", "userIdentifier : " + dimelo.getUserIdentifier() + ", userName :" + dimelo.getUserName() + ", authenticationInfo :"+ dimelo.getAuthenticationInfo());
}
@Override
public void onClose(Dimelo dimelo) {
super.onClose(dimelo);
Log.e("on open : ", "userIdentifier : " + dimelo.getUserIdentifier() + ", userName :" + dimelo.getUserName() + ", authenticationInfo :"+ dimelo.getAuthenticationInfo());
}
@Override
public void dimeloChatDidSendMessage() {
JSONObject messageContextInfo = new JSONObject();
try {
messageContextInfo.put("extra", "1234");
} catch (JSONException e) {
}
Dimelo.getInstance().setMessageContextInfo(messageContextInfo);
}
@Override
public void dimeloChatMessageSendFail(DimeloConnection.DimeloError error) {
// Something went wrong
// Minimal error management
String message = "An error occurred";
if (error.statusCode == DimeloConnection.DimeloError.NO_CONNECTION_ERROR) {
message = "Please check your Internet connection and try again later.";
} else if (error.statusCode == DimeloConnection.DimeloError.TIMEOUT_ERROR) {
message = "The server is not responding, please try again later";
}
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
}
};
static Dimelo setupDimelo(Context context) {
String secret = BuildConfig.DIMELO_SDK_SECRET; //edit in gradle.properties
String domainName = BuildConfig.DIMELO_SDK_DOMAIN_NAME; //edit in gradle.properties
Dimelo.setup(context);
Dimelo dimelo = Dimelo.getInstance();
dimelo.initWithApiSecret(secret, domainName, null);
dimelo.setDebug(true);
dimelo.setUserName("<NAME>");
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
if (refreshedToken != null)
dimelo.setDeviceToken(refreshedToken);
JSONObject authInfo = new JSONObject();
try {
authInfo.put("CustomerId", "0123456789");
authInfo.put("Dimelo", "<PASSWORD>!");
} catch (JSONException e) {
}
dimelo.setAuthenticationInfo(authInfo);
return dimelo;
}
@Override
public void onBackPressed() {
SlidingTabFragment mSlidingFragment = (SlidingTabFragment) getSupportFragmentManager().findFragmentByTag("mSlidingFragment");
if (mSlidingFragment != null && mSlidingFragment.isHandlingBack())
return;
super.onBackPressed();
}
// /**
// * Registers the application with GCM servers asynchronously.
// * <p/>
// * Stores the registration ID and app versionCode in the application's
// * shared preferences.
// */
// private void registerInBackground() {
// final Context mContext = getApplicationContext();
// AsyncTask<Object, Void, String> task = new AsyncTask<Object, Void, String>() {
//
// private String mGcmRegistrationId;
//
// @Override
// protected String doInBackground(Object... params) {
// String msg;
// try {
// GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(mContext);
// mGcmRegistrationId = gcm.register(SENDER_ID);
// msg = "Device registered, registration ID=" + mGcmRegistrationId;
// } catch (IOException ex) {
// msg = "Error :" + ex.getMessage();
// }
// return msg;
// }
//
// @Override
// protected void onPostExecute(String msg) {
// Log.d("DimeloSampleApp", msg);
// Dimelo.getInstance().setDeviceToken(mGcmRegistrationId);
// }
// };
// task.execute(null, null, null);
// }
}
| 6,038 | 0.638111 | 0.635294 | 155 | 37.909676 | 33.52079 | 181 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.619355 | false | false | 0 |
a3d3eda7fcd6ec47c52c4623f516811dd5be7f5c | 10,376,640,994,853 | 082c09005c40c587ee4bca23b9572794133006ae | /Sample Code Exhibit/J3 Infix Calculator/Calc.java | d211b4a3300feb72dbe2c295698e9b73a37f034b | []
| no_license | jamesrohan/Projects_SampleCode_Exhibit_For_Employers | https://github.com/jamesrohan/Projects_SampleCode_Exhibit_For_Employers | e381def4012f43fef72b84d98294591340c661f6 | bd1b5765ddcda3f6f130fd6f4d98cc81e739ebd2 | refs/heads/master | 2021-01-23T07:09:38.935000 | 2017-09-05T16:22:03 | 2017-09-05T16:22:03 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*James Rohan Gangavarapu
* Calc.java
* Objective: To take the user inputed infix expression and convert it to postfix.
*Algorithm: Varies through methods.
*Data Structure: We use primarily use stack and StringBuffer.
*Input/Output:Various methods and constructors have different input, output conditions. It is explained in
detail below. Albeit the user input is mostly used for the program as a whole.
* */
import java.util.*;
public class Calc {
static int x;
/*main method
Purpose: To take the user inputed infix expression and convert it to postfix and to evalute the postfix expression.
Precondition: none.
Postcondition: none.
Algorithm: Uses an infinite while loop that is exited if the user input is "q". The infix input by user is first checked
for any errors, if an error is found the error is shown then the user is asked again to enter. If no error
is found the infix expresion is converted to postfix and evaluated.
*/
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String toEval;
while(true){
System.out.println("(Enter \"q\" to exit)Enter Infix Expression:");
String calc = in.next();
int x = Check_Error(calc);
if(calc.equalsIgnoreCase("q")){
System.exit(0);
}
else if((x==0 || x==1)&&!hasVarX(calc)){
toEval = InfixToPostfix(calc);
System.out.println("Postfix notation: "+toEval);
System.out.println("Value ="+ evaluatePostFix(toEval));
}else if((x==0 || x==1)&&hasVarX(calc)){
toEval = InfixToPostfix(calc);
System.out.println("Postfix notation: "+toEval);
System.out.println("Enter the value of x:");
String ValX = in.next();
String eval = SubstitueX(toEval,ValX);
System.out.println("Value ="+ evaluatePostFix(eval));
}else if(x==2){
System.out.println("Error in the infix notation, unaccounted open paranthesis");
continue;
}else if(x==3){
System.out.println("Error in the infix notation, unaccounted closed paranthesis");
continue;
}else if(x==4){
System.out.println("Error in the infix notation, operators in sucession");
continue;
}
}//End while
}//End main
/*InfixToPostfix method
Purpose: To take the user inputed infix expression and convert it to postfix expression.
Precondition: Accepts the user inputed String infix.
Postcondition: Returns the postfix notation in the form of string..
Algorithm: Uses a for loop for the length of the infix String and pushes and pops operator into the stack
while appending non operands to the output string.
*/
public static String InfixToPostfix(String infix)
{
Stack<Character> stack = new Stack<Character>();
String PFix= " "; //postfixString
for (int index = 0; index < infix.length(); ++index) {
char test = infix.charAt(index); // chValue
if (test == '(') {
stack.push('(');
} else if (test == ')') {
Character opera = stack.peek();
while (!(opera.equals('(')) && !(stack.isEmpty())) {
PFix += " "+ opera.charValue();
stack.pop();
opera = stack.peek();
}
stack.pop();
} else if (test == '+' || test == '-') {
//Stack is empty
if (stack.isEmpty()) {
stack.push(test);
//current Stack is not empty
} else {
Character opera = stack.peek();
while (!(stack.isEmpty() || opera.equals(new Character('(')) || opera.equals(new Character(')')))) {
stack.pop();
PFix+= " "+opera.charValue();
}
stack.push(test);
}
} else if (test == '*' || test == '/' || test=='%') {
if (stack.isEmpty()) {
stack.push(test);
} else {
Character opera = stack.peek();
while (!opera.equals(new Character('+')) && !opera.equals(new Character('-')) && !stack.isEmpty()) {
stack.pop();
PFix += " "+opera.charValue();
}
stack.push(test);
}
} else {
PFix+= " "+test;
}
}
while (!stack.isEmpty()) {
Character opera = stack.peek();
if (!opera.equals(new Character('('))) {
stack.pop();
PFix+= " "+opera.charValue();
}
}
return PFix;
}
/*evaluatePostFix method
Purpose: To mathematically evelauate a postfix expression.
Precondition: Accepts the postfix notation in the form of String.
Postcondition: Returns an integer value.
Algorithm: Uses stack and scanner class to do the arithmetic while pushing and poping from the stack.
*/
public static int evaluatePostFix(String str)
{
Scanner sc = new Scanner(str);
Stack<Integer> stack = new Stack<Integer>();
while (sc.hasNext()) {
if (sc.hasNextInt()) {
stack.push(sc.nextInt());
continue;
}
int n2 = stack.pop(); //b=n2
int n1 = stack.pop(); //a=n1
char op = sc.next().charAt(0);
if (op == '+') stack.push(n1 + n2);
else if (op == '-') stack.push(n1 - n2);
else if (op == '*') stack.push(n1 * n2);
else if (op == '/') stack.push(n1 / n2);
else if (op == '%') stack.push(n1 % n2);
}
sc.close();
return stack.pop();
}
/*hasVarX method
Purpose: To determine if the expression has variable "x".
Precondition: Accepts the postfix notation or infix notation but in my implementation i pass a post fix notation.
Postcondition: Returns a boolean value if x is found in the expression.
Algorithm: Uses a for loop for the length of the expression to find "x".
*/
public static boolean hasVarX(String PFix){
for(int i=0;i<PFix.length();i++){
String check = Character.toString(PFix.charAt(i));
if(check.equalsIgnoreCase("x")){
return true;
}
}
return false;
}
/*SubstitueX method
Purpose: To substitue the value of x in the expression.
Precondition: Accepts the expression in the form of string and the value of x also in the form of string.
Postcondition: Returns a string with the substituted value of x.
Algorithm: Uses replaceall method from the String class to replace "x" with value of x.
*/
public static String SubstitueX(String PFix,String x){
return PFix.replaceAll("x", x);
}
/*isOperator method
Purpose: To determine if the char input is an operator.
Precondition: Accepts a char value input.
Postcondition: Returns a boolean value, true if the input char is operator false if not.
Algorithm: Checks to see if the input char is any of the valid operator type using boolean logic.
*/
public static boolean isOperator(char in)
{
boolean re = in == '+' || in== '-' || in == '*' || in == '/' || in == '^'
|| in == '(' || in == ')' || in=='%';
return re;
}
/*Check_Error method
Purpose: To determine if the input String has any errors.
Precondition: Accepts an expressoin in the form of a String.
Postcondition: Returns a int value, 0 or 1 means there's no error, 2 means there's aleast one extra open prantheses
3 means theres atleast one extra closed parantheses.
Algorithm: Goes through the string using a for loop for the length of the string, counts the no. of open, closed
parantheses etc.
*/
public static int Check_Error(String pFix){
int count_Open = 0;
int count_Close = 0;
int re = 0;
boolean operator = false;
for(int i=0; i<pFix.length();i++){
char test = pFix.charAt(i);
String check = Character.toString(test);
//Checking for no.of open and close parantheses
if(check.equalsIgnoreCase("(")){
count_Open++;
}else if(check.equalsIgnoreCase(")")){
count_Close++;
}
//Checking to see if two operands occur in sucession.
if(isOperator(test)){
char test_1;
String check_1;
if(i!=pFix.length()-1){
test_1= pFix.charAt(i+1);
check_1 = Character.toString(test_1);
if(check.equalsIgnoreCase(check_1)){
operator = true;
break;
}
}
}
}//End for
if(count_Open == count_Close){
return 1;
}else if(count_Open > count_Close){
return 2;
}else if(count_Open<count_Close){
return 3;
}else if(operator == true){
return 4;
}
return re;
}
}//End class
| UTF-8 | Java | 10,065 | java | Calc.java | Java | [
{
"context": "/*James Rohan Gangavarapu\n* Calc.java\n* Objective: To take the user inputed",
"end": 25,
"score": 0.9998931884765625,
"start": 2,
"tag": "NAME",
"value": "James Rohan Gangavarapu"
}
]
| null | []
| /*<NAME>
* Calc.java
* Objective: To take the user inputed infix expression and convert it to postfix.
*Algorithm: Varies through methods.
*Data Structure: We use primarily use stack and StringBuffer.
*Input/Output:Various methods and constructors have different input, output conditions. It is explained in
detail below. Albeit the user input is mostly used for the program as a whole.
* */
import java.util.*;
public class Calc {
static int x;
/*main method
Purpose: To take the user inputed infix expression and convert it to postfix and to evalute the postfix expression.
Precondition: none.
Postcondition: none.
Algorithm: Uses an infinite while loop that is exited if the user input is "q". The infix input by user is first checked
for any errors, if an error is found the error is shown then the user is asked again to enter. If no error
is found the infix expresion is converted to postfix and evaluated.
*/
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String toEval;
while(true){
System.out.println("(Enter \"q\" to exit)Enter Infix Expression:");
String calc = in.next();
int x = Check_Error(calc);
if(calc.equalsIgnoreCase("q")){
System.exit(0);
}
else if((x==0 || x==1)&&!hasVarX(calc)){
toEval = InfixToPostfix(calc);
System.out.println("Postfix notation: "+toEval);
System.out.println("Value ="+ evaluatePostFix(toEval));
}else if((x==0 || x==1)&&hasVarX(calc)){
toEval = InfixToPostfix(calc);
System.out.println("Postfix notation: "+toEval);
System.out.println("Enter the value of x:");
String ValX = in.next();
String eval = SubstitueX(toEval,ValX);
System.out.println("Value ="+ evaluatePostFix(eval));
}else if(x==2){
System.out.println("Error in the infix notation, unaccounted open paranthesis");
continue;
}else if(x==3){
System.out.println("Error in the infix notation, unaccounted closed paranthesis");
continue;
}else if(x==4){
System.out.println("Error in the infix notation, operators in sucession");
continue;
}
}//End while
}//End main
/*InfixToPostfix method
Purpose: To take the user inputed infix expression and convert it to postfix expression.
Precondition: Accepts the user inputed String infix.
Postcondition: Returns the postfix notation in the form of string..
Algorithm: Uses a for loop for the length of the infix String and pushes and pops operator into the stack
while appending non operands to the output string.
*/
public static String InfixToPostfix(String infix)
{
Stack<Character> stack = new Stack<Character>();
String PFix= " "; //postfixString
for (int index = 0; index < infix.length(); ++index) {
char test = infix.charAt(index); // chValue
if (test == '(') {
stack.push('(');
} else if (test == ')') {
Character opera = stack.peek();
while (!(opera.equals('(')) && !(stack.isEmpty())) {
PFix += " "+ opera.charValue();
stack.pop();
opera = stack.peek();
}
stack.pop();
} else if (test == '+' || test == '-') {
//Stack is empty
if (stack.isEmpty()) {
stack.push(test);
//current Stack is not empty
} else {
Character opera = stack.peek();
while (!(stack.isEmpty() || opera.equals(new Character('(')) || opera.equals(new Character(')')))) {
stack.pop();
PFix+= " "+opera.charValue();
}
stack.push(test);
}
} else if (test == '*' || test == '/' || test=='%') {
if (stack.isEmpty()) {
stack.push(test);
} else {
Character opera = stack.peek();
while (!opera.equals(new Character('+')) && !opera.equals(new Character('-')) && !stack.isEmpty()) {
stack.pop();
PFix += " "+opera.charValue();
}
stack.push(test);
}
} else {
PFix+= " "+test;
}
}
while (!stack.isEmpty()) {
Character opera = stack.peek();
if (!opera.equals(new Character('('))) {
stack.pop();
PFix+= " "+opera.charValue();
}
}
return PFix;
}
/*evaluatePostFix method
Purpose: To mathematically evelauate a postfix expression.
Precondition: Accepts the postfix notation in the form of String.
Postcondition: Returns an integer value.
Algorithm: Uses stack and scanner class to do the arithmetic while pushing and poping from the stack.
*/
public static int evaluatePostFix(String str)
{
Scanner sc = new Scanner(str);
Stack<Integer> stack = new Stack<Integer>();
while (sc.hasNext()) {
if (sc.hasNextInt()) {
stack.push(sc.nextInt());
continue;
}
int n2 = stack.pop(); //b=n2
int n1 = stack.pop(); //a=n1
char op = sc.next().charAt(0);
if (op == '+') stack.push(n1 + n2);
else if (op == '-') stack.push(n1 - n2);
else if (op == '*') stack.push(n1 * n2);
else if (op == '/') stack.push(n1 / n2);
else if (op == '%') stack.push(n1 % n2);
}
sc.close();
return stack.pop();
}
/*hasVarX method
Purpose: To determine if the expression has variable "x".
Precondition: Accepts the postfix notation or infix notation but in my implementation i pass a post fix notation.
Postcondition: Returns a boolean value if x is found in the expression.
Algorithm: Uses a for loop for the length of the expression to find "x".
*/
public static boolean hasVarX(String PFix){
for(int i=0;i<PFix.length();i++){
String check = Character.toString(PFix.charAt(i));
if(check.equalsIgnoreCase("x")){
return true;
}
}
return false;
}
/*SubstitueX method
Purpose: To substitue the value of x in the expression.
Precondition: Accepts the expression in the form of string and the value of x also in the form of string.
Postcondition: Returns a string with the substituted value of x.
Algorithm: Uses replaceall method from the String class to replace "x" with value of x.
*/
public static String SubstitueX(String PFix,String x){
return PFix.replaceAll("x", x);
}
/*isOperator method
Purpose: To determine if the char input is an operator.
Precondition: Accepts a char value input.
Postcondition: Returns a boolean value, true if the input char is operator false if not.
Algorithm: Checks to see if the input char is any of the valid operator type using boolean logic.
*/
public static boolean isOperator(char in)
{
boolean re = in == '+' || in== '-' || in == '*' || in == '/' || in == '^'
|| in == '(' || in == ')' || in=='%';
return re;
}
/*Check_Error method
Purpose: To determine if the input String has any errors.
Precondition: Accepts an expressoin in the form of a String.
Postcondition: Returns a int value, 0 or 1 means there's no error, 2 means there's aleast one extra open prantheses
3 means theres atleast one extra closed parantheses.
Algorithm: Goes through the string using a for loop for the length of the string, counts the no. of open, closed
parantheses etc.
*/
public static int Check_Error(String pFix){
int count_Open = 0;
int count_Close = 0;
int re = 0;
boolean operator = false;
for(int i=0; i<pFix.length();i++){
char test = pFix.charAt(i);
String check = Character.toString(test);
//Checking for no.of open and close parantheses
if(check.equalsIgnoreCase("(")){
count_Open++;
}else if(check.equalsIgnoreCase(")")){
count_Close++;
}
//Checking to see if two operands occur in sucession.
if(isOperator(test)){
char test_1;
String check_1;
if(i!=pFix.length()-1){
test_1= pFix.charAt(i+1);
check_1 = Character.toString(test_1);
if(check.equalsIgnoreCase(check_1)){
operator = true;
break;
}
}
}
}//End for
if(count_Open == count_Close){
return 1;
}else if(count_Open > count_Close){
return 2;
}else if(count_Open<count_Close){
return 3;
}else if(operator == true){
return 4;
}
return re;
}
}//End class
| 10,048 | 0.511972 | 0.507501 | 271 | 36.140221 | 29.754883 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.490775 | false | false | 0 |
443be477e61ad560947931152d886bd7804972fb | 14,465,449,858,876 | 84bb01e494b03dad143c415a926a3dfc0c8f2fb1 | /app/src/main/java/com/example/idontcare/data/LoginViewModel.java | 22c23bd90083071bf52217f4c5e766e30c0ae4f8 | []
| no_license | NateA21/androidApp | https://github.com/NateA21/androidApp | 659afdd5e0df4f0f4eea59a96ca142146a1e2be0 | dd0a293491aef807a2e4f29b793932a568304e5f | refs/heads/master | 2021-02-26T10:11:45.948000 | 2020-05-06T22:56:06 | 2020-05-06T22:56:06 | 245,518,912 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.idontcare.data;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.example.idontcare.data.model.LoggedInUser;
import java.util.List;
public class LoginViewModel extends AndroidViewModel {
private LoginRepository repository;
private LiveData<List<LoggedInUser>> allUsers;
private LiveData<Boolean> validLogin;
private LoggedInUser validLogin1;
public LoginViewModel(@NonNull Application application) {
super(application);
repository = new LoginRepository(application);
allUsers = repository.getAllUsers();
}
public void insert(LoggedInUser user) {
repository.insert(user);
}
public LiveData<List<LoggedInUser>> getAllUsers() {
return allUsers;
}
public LoggedInUser checkLogin(String displayName, String password) {
validLogin1 = repository.checkLogin(displayName, password);
return validLogin1;
}
}
| UTF-8 | Java | 1,044 | java | LoginViewModel.java | Java | []
| null | []
| package com.example.idontcare.data;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.example.idontcare.data.model.LoggedInUser;
import java.util.List;
public class LoginViewModel extends AndroidViewModel {
private LoginRepository repository;
private LiveData<List<LoggedInUser>> allUsers;
private LiveData<Boolean> validLogin;
private LoggedInUser validLogin1;
public LoginViewModel(@NonNull Application application) {
super(application);
repository = new LoginRepository(application);
allUsers = repository.getAllUsers();
}
public void insert(LoggedInUser user) {
repository.insert(user);
}
public LiveData<List<LoggedInUser>> getAllUsers() {
return allUsers;
}
public LoggedInUser checkLogin(String displayName, String password) {
validLogin1 = repository.checkLogin(displayName, password);
return validLogin1;
}
}
| 1,044 | 0.73659 | 0.733716 | 41 | 24.463415 | 22.980476 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.487805 | false | false | 0 |
d028014dd31396861835b1f38d3477911a60e4a3 | 16,200,616,649,125 | b9ecd93fafb4738d12a1d72f46db4d32e528b8d9 | /Apps/Durbodax/tests/durbodax/commands/customer/UpdateCustomerAgeTest.java | f3b9c77b020fb303c31822dd55b8b11eab96b2b5 | []
| no_license | boyangwm/TestStereotype | https://github.com/boyangwm/TestStereotype | ce1e3690d8f935f8c70898f3920914bd73d93754 | b5ad9fd6fc4c3e4ebf36b0b48fbbef2f0d42d6f9 | refs/heads/master | 2021-03-27T19:15:19.846000 | 2018-03-20T01:30:06 | 2018-03-20T01:30:06 | 47,856,052 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package durbodax.commands.customer;
import durbodax.customers.CustomerData;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Kirk Seddon
*/
public class UpdateCustomerAgeTest {
public UpdateCustomerAgeTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of execute method, of class UpdateCustomerAge.
*/
@Test
public void testExecute() {
System.out.println("execute");
String[] input = new String[] { "command", "100" };
UpdateCustomerAge instance = new UpdateCustomerAge();
instance.execute(input);
assertEquals(100, CustomerData.CUSTOMER.getCustomer().getAge());
}
} | UTF-8 | Java | 1,013 | java | UpdateCustomerAgeTest.java | Java | [
{
"context": "port static org.junit.Assert.*;\n\n/**\n *\n * @author Kirk Seddon\n */\npublic class UpdateCustomerAgeTest {\n\n pub",
"end": 272,
"score": 0.9998136162757874,
"start": 261,
"tag": "NAME",
"value": "Kirk Seddon"
}
]
| null | []
| package durbodax.commands.customer;
import durbodax.customers.CustomerData;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author <NAME>
*/
public class UpdateCustomerAgeTest {
public UpdateCustomerAgeTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of execute method, of class UpdateCustomerAge.
*/
@Test
public void testExecute() {
System.out.println("execute");
String[] input = new String[] { "command", "100" };
UpdateCustomerAge instance = new UpdateCustomerAge();
instance.execute(input);
assertEquals(100, CustomerData.CUSTOMER.getCustomer().getAge());
}
} | 1,008 | 0.652517 | 0.646594 | 50 | 19.280001 | 19.702833 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.32 | false | false | 0 |
67ae47858150ea8f295638d13741c001f512e355 | 28,183,575,402,953 | a116eca1085d6026bbfe188a876e8ab118ac0af2 | /src/main/java/com/ue/townsystem/logic/impl/TownSystemException.java | e98ee781edf00a87f12ef4bddac58ce235912224 | []
| no_license | SlackaGaming/Ultimate_Economy | https://github.com/SlackaGaming/Ultimate_Economy | 251517db920abca968f5d2bbbaa0ffcb23322f91 | dac2d6fdebfe37d8edd800bc62a8f78f6a5d156a | refs/heads/master | 2023-04-01T11:45:29.105000 | 2020-10-26T18:46:31 | 2020-10-26T18:46:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ue.townsystem.logic.impl;
import com.ue.common.utils.MessageWrapper;
public class TownSystemException extends Exception {
private static final long serialVersionUID = 1L;
private final MessageWrapper messageWrapper;
private TownExceptionMessageEnum key;
private Object[] params;
/**
* Default constructor.
* @param key
* @param params
* @param messageWrapper
*/
public TownSystemException(MessageWrapper messageWrapper, TownExceptionMessageEnum key, Object... params) {
super();
this.key = key;
this.params = params;
this.messageWrapper = messageWrapper;
}
@Override
public String getMessage() {
return messageWrapper.getErrorString(key.getValue(), params);
}
/**
* Returns the params.
* @return object array
*/
public Object[] getParams() {
return params;
}
/**
* Returns the message key.
*
* @return key
*/
public TownExceptionMessageEnum getKey() {
return key;
}
}
| UTF-8 | Java | 994 | java | TownSystemException.java | Java | []
| null | []
| package com.ue.townsystem.logic.impl;
import com.ue.common.utils.MessageWrapper;
public class TownSystemException extends Exception {
private static final long serialVersionUID = 1L;
private final MessageWrapper messageWrapper;
private TownExceptionMessageEnum key;
private Object[] params;
/**
* Default constructor.
* @param key
* @param params
* @param messageWrapper
*/
public TownSystemException(MessageWrapper messageWrapper, TownExceptionMessageEnum key, Object... params) {
super();
this.key = key;
this.params = params;
this.messageWrapper = messageWrapper;
}
@Override
public String getMessage() {
return messageWrapper.getErrorString(key.getValue(), params);
}
/**
* Returns the params.
* @return object array
*/
public Object[] getParams() {
return params;
}
/**
* Returns the message key.
*
* @return key
*/
public TownExceptionMessageEnum getKey() {
return key;
}
}
| 994 | 0.682093 | 0.681087 | 47 | 19.148935 | 21.247257 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.319149 | false | false | 0 |
56032a73343458fa8d4740036f8264fb5a40ddb3 | 30,124,900,620,550 | 048ed0c5110e8318384316a3ec8a13798f4db22b | /src/edu/bath/soak/dhcp/model/DHCPServer.java | cf505ff1126fcd03ad9b8ce7a2aed032ab51a60b | []
| no_license | zootalures/soak-hosts-manager | https://github.com/zootalures/soak-hosts-manager | 359884c60441878e9fcaeebadae7a7815f2e4801 | ef7b362827f8d571ccdfed4da2e81fed926c81b8 | refs/heads/master | 2021-01-25T05:34:23.426000 | 2015-06-27T11:34:19 | 2015-06-27T11:34:19 | 32,139,451 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package edu.bath.soak.dhcp.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
@Entity
public class DHCPServer implements Serializable{
Long id;
String displayName;
List<DHCPScope> scopes;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((displayName == null) ? 0 : displayName.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final DHCPServer other = (DHCPServer) obj;
if (displayName == null) {
if (other.displayName != null)
return false;
} else if (!displayName.equals(other.displayName))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@OneToMany(targetEntity=DHCPScope.class,mappedBy="server")
@OrderBy(value="minIP")
public List<DHCPScope> getScopes() {
return scopes;
}
public void setScopes(List<DHCPScope> scopes) {
this.scopes = scopes;
}
}
| UTF-8 | Java | 1,687 | java | DHCPServer.java | Java | []
| null | []
| package edu.bath.soak.dhcp.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
@Entity
public class DHCPServer implements Serializable{
Long id;
String displayName;
List<DHCPScope> scopes;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((displayName == null) ? 0 : displayName.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final DHCPServer other = (DHCPServer) obj;
if (displayName == null) {
if (other.displayName != null)
return false;
} else if (!displayName.equals(other.displayName))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@OneToMany(targetEntity=DHCPScope.class,mappedBy="server")
@OrderBy(value="minIP")
public List<DHCPScope> getScopes() {
return scopes;
}
public void setScopes(List<DHCPScope> scopes) {
this.scopes = scopes;
}
}
| 1,687 | 0.693539 | 0.690575 | 79 | 20.354431 | 16.579718 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.683544 | false | false | 0 |
8fdd0901b9d630b87851f56dc384b6661dc66eb3 | 13,434,657,714,039 | 94470e1638c0f89be8818e3970dd87c4b4690f5a | /src/main/java/club/itbus/wechat/model/message/BaseMessage.java | 1dc36f57d3485f3cf26a23fe2a9c31a18c8cf59d | []
| no_license | jasonbourn/WeChat-1 | https://github.com/jasonbourn/WeChat-1 | 32f985abefbc54daa70935765889a748ef7d9126 | cec258e037de43b634b89828bae07c3d3ce2aeab | refs/heads/master | 2021-01-20T05:12:47.223000 | 2016-03-01T03:43:42 | 2016-03-01T03:43:42 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package club.itbus.wechat.model.message;
import lombok.Data;
import java.io.Serializable;
/**
* Desc:被动回复消息基类
* author:HeHaiYang
* Date:15/12/21
*/
@Data
public class BaseMessage implements Serializable{
private static final long serialVersionUID = 2309472159964099833L;
// 接收方帐号(收到的OpenID)
private String ToUserName;
// 开发者微信号
private String FromUserName;
// 消息创建时间(整型)
private Long CreateTime;
// 消息类型
private String MsgType;
}
| UTF-8 | Java | 582 | java | BaseMessage.java | Java | [
{
"context": "Serializable;\r\n\r\n/**\r\n * Desc:被动回复消息基类\r\n * author:HeHaiYang\r\n * Date:15/12/21\r\n */\r\n@Data\r\npublic class BaseM",
"end": 141,
"score": 0.9737067222595215,
"start": 132,
"tag": "NAME",
"value": "HeHaiYang"
}
]
| null | []
| package club.itbus.wechat.model.message;
import lombok.Data;
import java.io.Serializable;
/**
* Desc:被动回复消息基类
* author:HeHaiYang
* Date:15/12/21
*/
@Data
public class BaseMessage implements Serializable{
private static final long serialVersionUID = 2309472159964099833L;
// 接收方帐号(收到的OpenID)
private String ToUserName;
// 开发者微信号
private String FromUserName;
// 消息创建时间(整型)
private Long CreateTime;
// 消息类型
private String MsgType;
}
| 582 | 0.667984 | 0.618577 | 26 | 17.461538 | 17.360943 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 0 |
f71c2eba609fbd4f7f34d213b99f1629177be550 | 21,706,764,727,868 | 6f9432fd19fea9c7384626fd6a66a054c70c12dc | /src/main/java/com/macys/survey/model/QuestionsByExperience.java | 72d283e63b6db80f3370a3d11baa499e6b4ad0fc | []
| no_license | ppaia/SurveyBackend | https://github.com/ppaia/SurveyBackend | f1da34a4892f5d70cd4f38c720ee530106d256f1 | dc1aa19d8cda96d1c47fd1d2f45797b54076c5e4 | refs/heads/master | 2023-05-08T21:31:23.306000 | 2020-05-21T12:56:58 | 2020-05-21T12:56:58 | 261,726,795 | 0 | 0 | null | false | 2023-04-14T17:57:08 | 2020-05-06T10:33:52 | 2020-05-21T12:57:46 | 2023-04-14T17:57:07 | 484 | 0 | 0 | 1 | Java | false | false | package com.macys.survey.model;
import java.util.List;
public class QuestionsByExperience {
String expName;
List<Question> surveyQuiz;
public String getExpName() {
return expName;
}
public void setExpName(String expName) {
this.expName = expName;
}
public List<Question> getSurveyQuiz() {
return surveyQuiz;
}
public void setSurveyQuiz(List<Question> surveyQuiz) {
this.surveyQuiz = surveyQuiz;
}
}
| UTF-8 | Java | 479 | java | QuestionsByExperience.java | Java | []
| null | []
| package com.macys.survey.model;
import java.util.List;
public class QuestionsByExperience {
String expName;
List<Question> surveyQuiz;
public String getExpName() {
return expName;
}
public void setExpName(String expName) {
this.expName = expName;
}
public List<Question> getSurveyQuiz() {
return surveyQuiz;
}
public void setSurveyQuiz(List<Question> surveyQuiz) {
this.surveyQuiz = surveyQuiz;
}
}
| 479 | 0.653445 | 0.653445 | 26 | 17.423077 | 17.451412 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 0 |
ca7b6d2905278bc4b7f0dd01df9700ec82240fc1 | 10,041,633,593,677 | 099b6e45945e6db4e7ef72417593457c827585c4 | /src/适配器模式/类适配器/IEx.java | f4a05120f79a4b4dd232a8205b5704fb6e317b39 | []
| no_license | zhangjianembedded/JavaDesignPatternDemo | https://github.com/zhangjianembedded/JavaDesignPatternDemo | 3a43964c926ac21eb674b8f01ab49e0945b935ac | a3f93b4bbabc81f01b7d45a74488eef0f1b1142b | refs/heads/master | 2021-01-10T01:45:26.538000 | 2016-01-26T15:46:20 | 2016-01-26T15:46:20 | 50,438,949 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package 适配器模式.类适配器;
public interface IEx {
void method1();
void method2();
}
| UTF-8 | Java | 99 | java | IEx.java | Java | []
| null | []
| package 适配器模式.类适配器;
public interface IEx {
void method1();
void method2();
}
| 99 | 0.691358 | 0.666667 | 7 | 10.571428 | 9.068897 | 22 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.714286 | false | false | 0 |
940c2ba0866f8794420509710814f43f52d59253 | 30,554,397,390,742 | a2df5416b97c608cc33daac0463c5c55991f71c7 | /src/main/java/com/example/performance/rest/PostRestController.java | c9c418d0b5f418eb4cd2ca54caf3979f21e88056 | []
| no_license | dizonn/java_performance_example | https://github.com/dizonn/java_performance_example | 12911a4e7a717fcfa28fe8b2f4e403b0a57f3d3e | 72b97911f55c20a2fa6f257e263378e2e9162d91 | refs/heads/master | 2023-04-20T09:02:42.643000 | 2021-04-29T10:49:08 | 2021-04-29T10:49:08 | 362,783,136 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.performance.rest;
import com.example.performance.domain.ex1.Post;
import com.example.performance.domain.ex1.PostDetails;
import com.example.performance.dto.PostDto;
import com.example.performance.repository.PostRepository;
import com.example.performance.service.PostService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;
import java.util.Map;
import java.util.Set;
@RestController
@RequiredArgsConstructor
@RequestMapping("/post")
public class PostRestController {
private final PostRepository postRepository;
private final PostService postService;
@GetMapping("/lazyInit1")
public List<Post> getPostsLazyInit1() {
return postRepository.findAll();
}
@GetMapping("/lazyInit2")
public List<Post> getPostsLazyInit2() {
return postRepository.getAllPostsWithWrongJoinFetch();
}
@GetMapping("/lazyInit3")
public List<Post> getPostsLazyInit4() {
return postRepository.getAllPostsWithWrightJoinFetchAndRemovedDuplicates();
}
@GetMapping("/lazyInit4")
public List<Post> getPostsLazyInit5() {
return postRepository.getAllPostsWithAdHocEntityGraph();
}
@GetMapping("/transaction1")
public List<Post> getPostsInTransaction() {
return postService.getAllPostsWithAdHocEntityGraph();
}
@GetMapping("/transaction2")
public List<Post> getPostsInTransactionReadOnly() {
return postService.getAllPostsWithAdHocEntityGraphReadOnly();
}
@GetMapping("/transaction3")
public List<Post> getPostsInTransactionReadOnlySupports() {
return postService.getAllPostsWithAdHocEntityGraphReadOnlySupports();
}
@GetMapping("/logicInCode1")
public Map<Long, Integer> countNumberOfCommentsPerPostBad() {
return postService.countNumberOfCommentsPerPostBad();
}
@GetMapping("/logicInCode2")
public List<Object[]> countNumberOfCommentsPerPostGood() {
return postService.countNumberOfCommentsPerPostGood();
}
@GetMapping("/dto")
public List<PostDto> getDtos() {
return postService.getDtos();
}
@GetMapping("/searchInList1")
public Map<Post, PostDetails> searchInList1() {
return postService.searchInList1();
}
@GetMapping("/searchInList2")
public Map<Post, PostDetails> searchInList2() {
return postService.searchInList2();
}
@GetMapping("/removeDuplicates1")
public List<Post> removeDuplicates1() {
return postService.removeDuplicates1();
}
@GetMapping("/removeDuplicates2")
public List<Post> removeDuplicates2() {
return postService.removeDuplicates2();
}
@GetMapping("/removeAllFromSet1")
public Set<Post> removeAllFromSet1() {
return postService.removeAllFromSet1();
}
@GetMapping("/removeAllFromSet2")
public Set<Post> removeAllFromSet2() {
return postService.removeAllFromSet2();
}
}
| UTF-8 | Java | 3,205 | java | PostRestController.java | Java | []
| null | []
| package com.example.performance.rest;
import com.example.performance.domain.ex1.Post;
import com.example.performance.domain.ex1.PostDetails;
import com.example.performance.dto.PostDto;
import com.example.performance.repository.PostRepository;
import com.example.performance.service.PostService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;
import java.util.Map;
import java.util.Set;
@RestController
@RequiredArgsConstructor
@RequestMapping("/post")
public class PostRestController {
private final PostRepository postRepository;
private final PostService postService;
@GetMapping("/lazyInit1")
public List<Post> getPostsLazyInit1() {
return postRepository.findAll();
}
@GetMapping("/lazyInit2")
public List<Post> getPostsLazyInit2() {
return postRepository.getAllPostsWithWrongJoinFetch();
}
@GetMapping("/lazyInit3")
public List<Post> getPostsLazyInit4() {
return postRepository.getAllPostsWithWrightJoinFetchAndRemovedDuplicates();
}
@GetMapping("/lazyInit4")
public List<Post> getPostsLazyInit5() {
return postRepository.getAllPostsWithAdHocEntityGraph();
}
@GetMapping("/transaction1")
public List<Post> getPostsInTransaction() {
return postService.getAllPostsWithAdHocEntityGraph();
}
@GetMapping("/transaction2")
public List<Post> getPostsInTransactionReadOnly() {
return postService.getAllPostsWithAdHocEntityGraphReadOnly();
}
@GetMapping("/transaction3")
public List<Post> getPostsInTransactionReadOnlySupports() {
return postService.getAllPostsWithAdHocEntityGraphReadOnlySupports();
}
@GetMapping("/logicInCode1")
public Map<Long, Integer> countNumberOfCommentsPerPostBad() {
return postService.countNumberOfCommentsPerPostBad();
}
@GetMapping("/logicInCode2")
public List<Object[]> countNumberOfCommentsPerPostGood() {
return postService.countNumberOfCommentsPerPostGood();
}
@GetMapping("/dto")
public List<PostDto> getDtos() {
return postService.getDtos();
}
@GetMapping("/searchInList1")
public Map<Post, PostDetails> searchInList1() {
return postService.searchInList1();
}
@GetMapping("/searchInList2")
public Map<Post, PostDetails> searchInList2() {
return postService.searchInList2();
}
@GetMapping("/removeDuplicates1")
public List<Post> removeDuplicates1() {
return postService.removeDuplicates1();
}
@GetMapping("/removeDuplicates2")
public List<Post> removeDuplicates2() {
return postService.removeDuplicates2();
}
@GetMapping("/removeAllFromSet1")
public Set<Post> removeAllFromSet1() {
return postService.removeAllFromSet1();
}
@GetMapping("/removeAllFromSet2")
public Set<Post> removeAllFromSet2() {
return postService.removeAllFromSet2();
}
}
| 3,205 | 0.730109 | 0.719813 | 106 | 29.226416 | 22.834633 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.339623 | false | false | 0 |
c14a86da6ad2d0a0e7b7d5f16e3bab5fb3b5573c | 35,485,019,804,290 | bce3a175dfd49995856eabedb5a51d1d3c1898b1 | /src/main/java/com/reactivetechnologies/hzdfs/core/DistributedFileSupportService.java | cb25debb541428e88dc0db5f3f3c7c03b5da5d85 | []
| no_license | javanotes/hzdfs | https://github.com/javanotes/hzdfs | 388dbcd225c1933039a26a762a20b4a3e93cfd36 | 58712ba716ee910ca93344a3b6d1fdbb09a1e278 | refs/heads/master | 2020-12-24T21:11:41.885000 | 2017-05-04T13:59:49 | 2017-05-04T13:59:49 | 56,148,751 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /* ============================================================================
*
* FILE: DistributedFileSupportService.java
*
The MIT License (MIT)
Copyright (c) 2016 Sutanu Dalui
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*
* ============================================================================
*/
package com.reactivetechnologies.hzdfs.core;
import java.io.File;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.hazelcast.core.ICountDownLatch;
import com.hazelcast.core.Message;
import com.reactivetechnologies.hzdfs.IDistributedFileSupport;
import com.reactivetechnologies.hzdfs.cluster.HazelcastClusterServiceBean;
import com.reactivetechnologies.hzdfs.cluster.IMapConfig;
import com.reactivetechnologies.hzdfs.cluster.MessageChannel;
import com.reactivetechnologies.hzdfs.dto.DFSSCommand;
import com.reactivetechnologies.hzdfs.dto.DFSSResponse;
import com.reactivetechnologies.hzdfs.dto.DFSSTaskConfig;
/**
* Implementation class for {@linkplain IDistributedFileSupport}.
*/
@Service
public class DistributedFileSupportService implements MessageChannel<DFSSCommand>, IDistributedFileSupport {
private static final Logger log = LoggerFactory.getLogger(DistributedFileSupportService.class);
@Autowired HazelcastClusterServiceBean hzService;
/**
*
*/
public DistributedFileSupportService() {
}
private String commandTopicId;
@Value("${dfss.threadCount:4}")
private int nThreads;
private IMapConfig recordMapCfg;
@PostConstruct
private void init()
{
commandTopicId = hzService.addMessageChannel(this);
threads = Executors.newFixedThreadPool(nThreads, new ThreadFactory() {
int n=0;
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "DFSS-Worker-"+(n++));
return t;
}
});
recordMapCfg = RecordMapConfig.class.getAnnotation(IMapConfig.class);
log.info("[DFSS] File distribution service initialized");
}
@PreDestroy
private void destroy()
{
threads.shutdown();
try {
threads.awaitTermination(60, TimeUnit.SECONDS);
} catch (InterruptedException e) {
}
hzService.removeMessageChannel(topic(), commandTopicId);
removeAllDistributor();
}
/* (non-Javadoc)
* @see com.reactive.hzdfs.core.IDistributedFileSystem#distribute(java.io.File)
*/
@Override
public Future<DFSSResponse> distribute(File sourceFile, DFSSTaskConfig config) throws IOException
{
log.info("[DFSS] Initiating distribution for local file "+sourceFile+"; Checking attributes..");
checkFile(sourceFile);
DFSSTaskExecutor w = prepareTaskExecutor(sourceFile, config);
log.info("[DFSS#"+w.sessionId+"] Coordinator prepared. Submitting task for execution..");
return threads.submit(w);
}
private ExecutorService threads;
/**
*
* @param sourceFile
* @param config
* @return
* @throws IOException
*/
private DFSSTaskExecutor prepareTaskExecutor(File sourceFile, DFSSTaskConfig config) throws IOException
{
DFSSCommand cmd = prepareCluster(sourceFile, config);
DFSSTaskExecutor w = new DFSSTaskExecutor(this, sourceFile.getName().toUpperCase(), sourceFile, createChunkCollector(cmd));
w.sessionId = cmd.getSessionId();
w.recordMap = cmd.getRecordMap();
return w;
}
//private CountDownLatch latch;
/**
*
* @param sourceFile
* @throws IOException
*/
private void checkFile(File sourceFile) throws IOException
{
if(sourceFile == null)
throw new IOException("Source file is null");
if(!sourceFile.exists())
throw new IOException("Source file does not exist");
if(!sourceFile.isFile())
throw new IOException("Not a valid file");
if(!sourceFile.canRead())
throw new IOException("Cannot read source file");
}
private static String chunkMapName(File sourceFile)
{
//TODO: Using replaceAll breaks the code!!
return sourceFile.getName()/*.replaceAll("\\.", "_")*/.toUpperCase();
}
private ICountDownLatch sessionLatch(DFSSCommand cmd)
{
return hzService.getClusterLatch("DFSS_"+cmd.getSessionId());
}
/**
*
* @param sourceFile
* @param config
* @return
* @throws IOException
*/
private DFSSCommand prepareCluster(File sourceFile, DFSSTaskConfig config) throws IOException {
DFSSCommand cmd = new DFSSCommand();
cmd.setConfig(config);
log.info("[DFSS] New task created with sessionId => "+cmd.getSessionId()+" for file => "+sourceFile);
cmd.setCommand(DFSSCommand.CMD_INIT_ASCII_RCVRS);
cmd.setChunkMap(chunkMapName(sourceFile));
cmd.setRecordMap(cmd.getChunkMap()+"-REC");
sendMessage(cmd);
ICountDownLatch latch = sessionLatch(cmd);
try
{
log.info("[DFSS#"+cmd.getSessionId()+"] Preparing cluster for file distribution.. ");
boolean b = latch.await(config.getClusterPreparationTime().getDuration(), config.getClusterPreparationTime().getUnit());
if(!b)
{
cmd.setCommand(DFSSCommand.CMD_ABORT_JOB);
sendMessage(cmd);
throw new IOException("["+cmd.getSessionId()+"] Unable to prepare cluster for distribution in "+config+". Job aborted!");
}
}
catch (InterruptedException e) {
log.error("Aborting job on being interrupted unexpectedly", e);
cmd.setCommand(DFSSCommand.CMD_ABORT_JOB);
sendMessage(cmd);
throw new InterruptedIOException("["+cmd.getSessionId()+"] InterruptedException. Job aborted!");
}
finally
{
latch.destroy();
}
hzService.setMapConfiguration(recordMapCfg, cmd.getRecordMap());
log.info("[DFSS#"+cmd.getSessionId()+"] Cluster preparation complete..");
return cmd;
}
private final Map<String, FileChunkCollector> distributors = new WeakHashMap<>();
/**
*
* @param sessionId
*/
private void removeDistributor(String sessionId)
{
FileChunkCollector dist = distributors.remove(sessionId);
if(dist != null)
{
clean(dist);
}
}
private static void clean(FileChunkCollector dist)
{
dist.close();
dist.destroyTempDO();
}
/**
*
*/
private void removeAllDistributor()
{
for(Iterator<FileChunkCollector> iter = distributors.values().iterator(); iter.hasNext();)
{
FileChunkCollector afd = iter.next();
clean(afd);
iter.remove();
}
}
private FileChunkCollector createChunkCollector(DFSSCommand cmd)
{
FileChunkCollector dist = new FileChunkCollector(hzService, cmd.getRecordMap(), cmd.getChunkMap(), cmd.getSessionId(), cmd.getConfig());
distributors.put(cmd.getSessionId(), dist);
log.info("[DFSS#"+cmd.getSessionId()+"] New distribution task created for session..");
return dist;
}
@Override
public void onMessage(Message<DFSSCommand> message)
{
DFSSCommand cmd = message.getMessageObject();
if(DFSSCommand.CMD_INIT_ASCII_RCVRS.equals(cmd.getCommand()))
{
if(!message.getPublishingMember().localMember())
{
//will be closed by self
createChunkCollector(cmd);
sessionLatch(cmd).countDown();
}
}
else if(DFSSCommand.CMD_ABORT_JOB.equals(cmd.getCommand()))
{
removeDistributor(cmd.getSessionId());
}
}
@Override
public String topic() {
return DFSSCommand.class.getSimpleName().toUpperCase();
}
@Override
public void sendMessage(DFSSCommand message) {
hzService.publish(message, topic());
}
}
| UTF-8 | Java | 9,074 | java | DistributedFileSupportService.java | Java | [
{
"context": "e.java\n*\nThe MIT License (MIT)\n\nCopyright (c) 2016 Sutanu Dalui\n\nPermission is hereby granted, free of charge, to",
"end": 181,
"score": 0.9998881220817566,
"start": 169,
"tag": "NAME",
"value": "Sutanu Dalui"
}
]
| null | []
| /* ============================================================================
*
* FILE: DistributedFileSupportService.java
*
The MIT License (MIT)
Copyright (c) 2016 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*
* ============================================================================
*/
package com.reactivetechnologies.hzdfs.core;
import java.io.File;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.hazelcast.core.ICountDownLatch;
import com.hazelcast.core.Message;
import com.reactivetechnologies.hzdfs.IDistributedFileSupport;
import com.reactivetechnologies.hzdfs.cluster.HazelcastClusterServiceBean;
import com.reactivetechnologies.hzdfs.cluster.IMapConfig;
import com.reactivetechnologies.hzdfs.cluster.MessageChannel;
import com.reactivetechnologies.hzdfs.dto.DFSSCommand;
import com.reactivetechnologies.hzdfs.dto.DFSSResponse;
import com.reactivetechnologies.hzdfs.dto.DFSSTaskConfig;
/**
* Implementation class for {@linkplain IDistributedFileSupport}.
*/
@Service
public class DistributedFileSupportService implements MessageChannel<DFSSCommand>, IDistributedFileSupport {
private static final Logger log = LoggerFactory.getLogger(DistributedFileSupportService.class);
@Autowired HazelcastClusterServiceBean hzService;
/**
*
*/
public DistributedFileSupportService() {
}
private String commandTopicId;
@Value("${dfss.threadCount:4}")
private int nThreads;
private IMapConfig recordMapCfg;
@PostConstruct
private void init()
{
commandTopicId = hzService.addMessageChannel(this);
threads = Executors.newFixedThreadPool(nThreads, new ThreadFactory() {
int n=0;
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "DFSS-Worker-"+(n++));
return t;
}
});
recordMapCfg = RecordMapConfig.class.getAnnotation(IMapConfig.class);
log.info("[DFSS] File distribution service initialized");
}
@PreDestroy
private void destroy()
{
threads.shutdown();
try {
threads.awaitTermination(60, TimeUnit.SECONDS);
} catch (InterruptedException e) {
}
hzService.removeMessageChannel(topic(), commandTopicId);
removeAllDistributor();
}
/* (non-Javadoc)
* @see com.reactive.hzdfs.core.IDistributedFileSystem#distribute(java.io.File)
*/
@Override
public Future<DFSSResponse> distribute(File sourceFile, DFSSTaskConfig config) throws IOException
{
log.info("[DFSS] Initiating distribution for local file "+sourceFile+"; Checking attributes..");
checkFile(sourceFile);
DFSSTaskExecutor w = prepareTaskExecutor(sourceFile, config);
log.info("[DFSS#"+w.sessionId+"] Coordinator prepared. Submitting task for execution..");
return threads.submit(w);
}
private ExecutorService threads;
/**
*
* @param sourceFile
* @param config
* @return
* @throws IOException
*/
private DFSSTaskExecutor prepareTaskExecutor(File sourceFile, DFSSTaskConfig config) throws IOException
{
DFSSCommand cmd = prepareCluster(sourceFile, config);
DFSSTaskExecutor w = new DFSSTaskExecutor(this, sourceFile.getName().toUpperCase(), sourceFile, createChunkCollector(cmd));
w.sessionId = cmd.getSessionId();
w.recordMap = cmd.getRecordMap();
return w;
}
//private CountDownLatch latch;
/**
*
* @param sourceFile
* @throws IOException
*/
private void checkFile(File sourceFile) throws IOException
{
if(sourceFile == null)
throw new IOException("Source file is null");
if(!sourceFile.exists())
throw new IOException("Source file does not exist");
if(!sourceFile.isFile())
throw new IOException("Not a valid file");
if(!sourceFile.canRead())
throw new IOException("Cannot read source file");
}
private static String chunkMapName(File sourceFile)
{
//TODO: Using replaceAll breaks the code!!
return sourceFile.getName()/*.replaceAll("\\.", "_")*/.toUpperCase();
}
private ICountDownLatch sessionLatch(DFSSCommand cmd)
{
return hzService.getClusterLatch("DFSS_"+cmd.getSessionId());
}
/**
*
* @param sourceFile
* @param config
* @return
* @throws IOException
*/
private DFSSCommand prepareCluster(File sourceFile, DFSSTaskConfig config) throws IOException {
DFSSCommand cmd = new DFSSCommand();
cmd.setConfig(config);
log.info("[DFSS] New task created with sessionId => "+cmd.getSessionId()+" for file => "+sourceFile);
cmd.setCommand(DFSSCommand.CMD_INIT_ASCII_RCVRS);
cmd.setChunkMap(chunkMapName(sourceFile));
cmd.setRecordMap(cmd.getChunkMap()+"-REC");
sendMessage(cmd);
ICountDownLatch latch = sessionLatch(cmd);
try
{
log.info("[DFSS#"+cmd.getSessionId()+"] Preparing cluster for file distribution.. ");
boolean b = latch.await(config.getClusterPreparationTime().getDuration(), config.getClusterPreparationTime().getUnit());
if(!b)
{
cmd.setCommand(DFSSCommand.CMD_ABORT_JOB);
sendMessage(cmd);
throw new IOException("["+cmd.getSessionId()+"] Unable to prepare cluster for distribution in "+config+". Job aborted!");
}
}
catch (InterruptedException e) {
log.error("Aborting job on being interrupted unexpectedly", e);
cmd.setCommand(DFSSCommand.CMD_ABORT_JOB);
sendMessage(cmd);
throw new InterruptedIOException("["+cmd.getSessionId()+"] InterruptedException. Job aborted!");
}
finally
{
latch.destroy();
}
hzService.setMapConfiguration(recordMapCfg, cmd.getRecordMap());
log.info("[DFSS#"+cmd.getSessionId()+"] Cluster preparation complete..");
return cmd;
}
private final Map<String, FileChunkCollector> distributors = new WeakHashMap<>();
/**
*
* @param sessionId
*/
private void removeDistributor(String sessionId)
{
FileChunkCollector dist = distributors.remove(sessionId);
if(dist != null)
{
clean(dist);
}
}
private static void clean(FileChunkCollector dist)
{
dist.close();
dist.destroyTempDO();
}
/**
*
*/
private void removeAllDistributor()
{
for(Iterator<FileChunkCollector> iter = distributors.values().iterator(); iter.hasNext();)
{
FileChunkCollector afd = iter.next();
clean(afd);
iter.remove();
}
}
private FileChunkCollector createChunkCollector(DFSSCommand cmd)
{
FileChunkCollector dist = new FileChunkCollector(hzService, cmd.getRecordMap(), cmd.getChunkMap(), cmd.getSessionId(), cmd.getConfig());
distributors.put(cmd.getSessionId(), dist);
log.info("[DFSS#"+cmd.getSessionId()+"] New distribution task created for session..");
return dist;
}
@Override
public void onMessage(Message<DFSSCommand> message)
{
DFSSCommand cmd = message.getMessageObject();
if(DFSSCommand.CMD_INIT_ASCII_RCVRS.equals(cmd.getCommand()))
{
if(!message.getPublishingMember().localMember())
{
//will be closed by self
createChunkCollector(cmd);
sessionLatch(cmd).countDown();
}
}
else if(DFSSCommand.CMD_ABORT_JOB.equals(cmd.getCommand()))
{
removeDistributor(cmd.getSessionId());
}
}
@Override
public String topic() {
return DFSSCommand.class.getSimpleName().toUpperCase();
}
@Override
public void sendMessage(DFSSCommand message) {
hzService.publish(message, topic());
}
}
| 9,068 | 0.702336 | 0.701234 | 286 | 30.727272 | 30.253054 | 140 | false | false | 0 | 0 | 0 | 0 | 77 | 0.016972 | 0.524476 | false | false | 0 |
0f6b80f983ee4617864ad98ac2a8b7c7f5f7ea1e | 24,395,414,298,833 | ea7c88e1f41d361b09f6cbc95d4199cdffbe9caf | /src/main/java/LinkedList/LinkedList/LinkMain.java | c6ca83b3b7ee21e2dd2f9760471e430dbd754d44 | []
| no_license | Aquibsarwar/MyLinkedList | https://github.com/Aquibsarwar/MyLinkedList | 26f906c45f87a59cef99b3a68c81a8b6311bbbb7 | d36db968303f480eb82123727381be50f1700c36 | refs/heads/master | 2021-07-14T19:35:07.796000 | 2019-10-18T06:52:42 | 2019-10-18T06:52:42 | 215,745,442 | 0 | 0 | null | false | 2020-10-13T16:48:04 | 2019-10-17T08:47:34 | 2019-10-18T06:52:57 | 2020-10-13T16:48:03 | 8 | 0 | 0 | 1 | Java | false | false | package LinkedList.LinkedList;
public class LinkMain {
public static void main(String[] args) {
LinkListPractice linklist= new LinkListPractice();
linklist.insert(1);
linklist.insert(2);
linklist.insert(3);
linklist.insert(4);
linklist.insert(1);
linklist.insert(2);
linklist.insert(3);
linklist.insert(4);
linklist.insert(5);
//linklist.insertAtFirst(11);
//linklist.insertAtanyindex(2,45);
//linklist.insertAtanyindex(3,46);
//linklist.insertAtanyindex(0,0);
linklist.deleteList(8);
linklist.addlast(99);
linklist.show();
}
}
| UTF-8 | Java | 600 | java | LinkMain.java | Java | []
| null | []
| package LinkedList.LinkedList;
public class LinkMain {
public static void main(String[] args) {
LinkListPractice linklist= new LinkListPractice();
linklist.insert(1);
linklist.insert(2);
linklist.insert(3);
linklist.insert(4);
linklist.insert(1);
linklist.insert(2);
linklist.insert(3);
linklist.insert(4);
linklist.insert(5);
//linklist.insertAtFirst(11);
//linklist.insertAtanyindex(2,45);
//linklist.insertAtanyindex(3,46);
//linklist.insertAtanyindex(0,0);
linklist.deleteList(8);
linklist.addlast(99);
linklist.show();
}
}
| 600 | 0.675 | 0.638333 | 36 | 15.666667 | 14.191155 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.194444 | false | false | 0 |
ba45791d382320d3fc03959898ffac06f2d1a562 | 15,796,889,783,897 | 24a6b3e6edb9505837a7ce4b021f512da5438d81 | /src/com/ly/util/DataUtil.java | f254c3b1d93aacff1e91334890d12723fd938648 | []
| no_license | lyssg/plc | https://github.com/lyssg/plc | fcca0eb22e33aa2586bab7cb47281fbc9fa17271 | 573f2b7d6d695330d03c5ac46716d236590024b4 | refs/heads/master | 2020-12-30T15:29:24.554000 | 2018-11-25T02:32:17 | 2018-11-25T02:32:17 | 91,143,413 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ly.util;
public class DataUtil {
}
| UTF-8 | Java | 54 | java | DataUtil.java | Java | []
| null | []
| package com.ly.util;
public class DataUtil {
}
| 54 | 0.648148 | 0.648148 | 5 | 8.8 | 10.419213 | 23 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 0 |
c2442223674f008ab6e49a3de7f75c4b11affdf1 | 13,151,189,881,396 | 88d45ec1bb156b8d8aae0152c9883b127443304d | /src/main/java/com/postcode/au/api/controller/PostCodeController.java | 02b0a918d5329aefd82a2ce88e3507cda085f268 | []
| no_license | sharathnaagrea/PostCodeAPI-microservice | https://github.com/sharathnaagrea/PostCodeAPI-microservice | 4113a9cc03c6b47b937a3bbe63eb3bc08576245b | 30402163feb52db2afa1d9abae33f6804e126424 | refs/heads/main | 2023-07-17T22:01:59.007000 | 2021-09-02T13:24:37 | 2021-09-02T13:24:37 | 402,425,351 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.postcode.au.api.controller;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.Pattern;
import com.postcode.au.api.entity.PostCodeRecord;
import com.postcode.au.api.entity.SearchResult;
import com.postcode.au.api.exception.AuthenticationException;
import com.postcode.au.api.exception.ResourceNotFoundException;
import com.postcode.au.api.model.AuthenticationRequest;
import com.postcode.au.api.model.AuthenticationResponse;
import com.postcode.au.api.service.PostCodeServices;
import com.postcode.au.api.util.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestBody;
@RestController
@Api(description = "Postcode API")
public class PostCodeController {
@Autowired
private PostCodeServices service;
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
private UserDetailsService detailsService;
@Autowired
private JwtUtil jwtUtil;
@RequestMapping("/welcome")
public String home() {
return "Welcome to Post Code API";
}
/**
* Restful API to get token
*
* @param AuthenticationRequest
* @return JWT token
*/
@RequestMapping(value = "/api/v1/authenticate", method = RequestMethod.POST)
public ResponseEntity<AuthenticationResponse> createAuthenticationToken(
@RequestBody AuthenticationRequest authenticationRequest) throws Exception {
try {
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(
authenticationRequest.getUsername(), authenticationRequest.getPassword()));
} catch (BadCredentialsException e) {
throw new AuthenticationException("Authentication Failed");
}
final UserDetails userDetails = detailsService.loadUserByUsername(authenticationRequest.getUsername());
final String jwt = jwtUtil.generateToken(userDetails);
return ResponseEntity.ok(new AuthenticationResponse(jwt));
}
/**
* Restful API to search by postcode
*
* @param postcode must be 4 digits (Australian postcode)
* @return The JSON Response containing postcode ,suburb and state
*/
@RequestMapping(value = "/api/v1/postcode/{postcode}", method = RequestMethod.GET)
public SearchResult search(
@Valid @Pattern(regexp = "([0-9]{4})", message = "Invalid Australian PostCode Format") @PathVariable("postcode") String postcode) {
SearchResult result = new SearchResult();
result.setStatus(PostCodeServices.API_SUCCESS_STATUS);
List<PostCodeRecord> searchResult = service.searchByPostCode(postcode);
if (searchResult.isEmpty()) {
throw new ResourceNotFoundException("No details Found!");
}
result.setResult(searchResult);
return result;
}
/**
* Restful API to search by suburb
*
* @param suburb The Australian suburb Name
* @return The JSON Response containing postcode ,suburb and state
*/
@RequestMapping(value = "/api/v1/suburb/{suburbName}", method = RequestMethod.GET)
public SearchResult searchByStateAndsuburb(@PathVariable("suburbName") String suburbName) {
SearchResult result = new SearchResult();
result.setStatus(PostCodeServices.API_SUCCESS_STATUS);
List<PostCodeRecord> searchResult = service.searchBysuburb(suburbName);
if (searchResult.isEmpty()) {
throw new ResourceNotFoundException("No details Found!");
}
result.setResult(searchResult);
return result;
}
/**
* The Restful API to add new Postcode record to the database
*
* @param newRecord
* @return
*/
@RequestMapping(value = "/api/v1/secure/addrecord", method = RequestMethod.POST)
public PostCodeRecord addNewRecord(@Valid @RequestBody PostCodeRecord newRecord) {
return service.saveNewRecord(newRecord);
}
}
| UTF-8 | Java | 4,859 | java | PostCodeController.java | Java | []
| null | []
| package com.postcode.au.api.controller;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.Pattern;
import com.postcode.au.api.entity.PostCodeRecord;
import com.postcode.au.api.entity.SearchResult;
import com.postcode.au.api.exception.AuthenticationException;
import com.postcode.au.api.exception.ResourceNotFoundException;
import com.postcode.au.api.model.AuthenticationRequest;
import com.postcode.au.api.model.AuthenticationResponse;
import com.postcode.au.api.service.PostCodeServices;
import com.postcode.au.api.util.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestBody;
@RestController
@Api(description = "Postcode API")
public class PostCodeController {
@Autowired
private PostCodeServices service;
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
private UserDetailsService detailsService;
@Autowired
private JwtUtil jwtUtil;
@RequestMapping("/welcome")
public String home() {
return "Welcome to Post Code API";
}
/**
* Restful API to get token
*
* @param AuthenticationRequest
* @return JWT token
*/
@RequestMapping(value = "/api/v1/authenticate", method = RequestMethod.POST)
public ResponseEntity<AuthenticationResponse> createAuthenticationToken(
@RequestBody AuthenticationRequest authenticationRequest) throws Exception {
try {
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(
authenticationRequest.getUsername(), authenticationRequest.getPassword()));
} catch (BadCredentialsException e) {
throw new AuthenticationException("Authentication Failed");
}
final UserDetails userDetails = detailsService.loadUserByUsername(authenticationRequest.getUsername());
final String jwt = jwtUtil.generateToken(userDetails);
return ResponseEntity.ok(new AuthenticationResponse(jwt));
}
/**
* Restful API to search by postcode
*
* @param postcode must be 4 digits (Australian postcode)
* @return The JSON Response containing postcode ,suburb and state
*/
@RequestMapping(value = "/api/v1/postcode/{postcode}", method = RequestMethod.GET)
public SearchResult search(
@Valid @Pattern(regexp = "([0-9]{4})", message = "Invalid Australian PostCode Format") @PathVariable("postcode") String postcode) {
SearchResult result = new SearchResult();
result.setStatus(PostCodeServices.API_SUCCESS_STATUS);
List<PostCodeRecord> searchResult = service.searchByPostCode(postcode);
if (searchResult.isEmpty()) {
throw new ResourceNotFoundException("No details Found!");
}
result.setResult(searchResult);
return result;
}
/**
* Restful API to search by suburb
*
* @param suburb The Australian suburb Name
* @return The JSON Response containing postcode ,suburb and state
*/
@RequestMapping(value = "/api/v1/suburb/{suburbName}", method = RequestMethod.GET)
public SearchResult searchByStateAndsuburb(@PathVariable("suburbName") String suburbName) {
SearchResult result = new SearchResult();
result.setStatus(PostCodeServices.API_SUCCESS_STATUS);
List<PostCodeRecord> searchResult = service.searchBysuburb(suburbName);
if (searchResult.isEmpty()) {
throw new ResourceNotFoundException("No details Found!");
}
result.setResult(searchResult);
return result;
}
/**
* The Restful API to add new Postcode record to the database
*
* @param newRecord
* @return
*/
@RequestMapping(value = "/api/v1/secure/addrecord", method = RequestMethod.POST)
public PostCodeRecord addNewRecord(@Valid @RequestBody PostCodeRecord newRecord) {
return service.saveNewRecord(newRecord);
}
}
| 4,859 | 0.714345 | 0.712698 | 128 | 35.960938 | 31.213329 | 143 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4375 | false | false | 0 |
1f8b170165fb0d710ce2ee00f586f0069c8a2e9a | 13,280,038,920,320 | f0ee6711d2c67f90c69aaabc1b6f96c1da1f1af1 | /main/java/com/qm/sys/service/impl/RoleServiceImpl.java | 5e508f4d15c70fbb7e877d63f53a02515c0ce305 | []
| no_license | Ezreadl/webapp | https://github.com/Ezreadl/webapp | 3c910c0da282a1174113c49e5000a0652e00e378 | d94c3b92a0942716287d7d2f376a1f3cfdf528ab | refs/heads/master | 2021-01-24T11:35:51.169000 | 2018-02-28T10:06:31 | 2018-02-28T10:06:31 | 123,090,301 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.qm.sys.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qm.core.base.GridListData;
import com.qm.core.base.PageInfo;
import com.qm.core.util.DataListUtil;
import com.qm.core.util.DateUtil;
import com.qm.sys.dao.ISysRoleDao;
import com.qm.sys.domain.SysRole;
import com.qm.sys.domain.SysUser;
import com.qm.sys.query.SysRoleQuery;
import com.qm.sys.service.IRoleService;
@Service
public class RoleServiceImpl implements IRoleService {
@Autowired
private ISysRoleDao sysRoleDao;
@SuppressWarnings("unchecked")
@Override
public GridListData findAllRole(SysRoleQuery query, PageInfo pageInfo) throws Exception {
GridListData gridListData = sysRoleDao.findDataList1(query,pageInfo);
DataListUtil.formatDateList(gridListData.getRows(), new String[]{"optDateTime","addDateTime"});
return gridListData;
}
@Override
public SysRole findRoleById(int oid) {
return sysRoleDao.findOne(oid);
}
@Override
public List<SysRole> findRoleById(List<Integer> oidList) {
return sysRoleDao.findAll(oidList);
}
@Override
public List<SysRole> findLowRole(int oid) {
return sysRoleDao.findLowRole(oid);
}
@Override
public void changeDelFlg(SysUser sysUser, List<Integer> oidList, int delFlg) {
List<SysRole> roleList=sysRoleDao.findAll(oidList);
for(SysRole role : roleList){
role.setOptUserName(sysUser.getUserName());
role.setOptDateTime(DateUtil.getDate());
role.setDelFlg(delFlg);
sysRoleDao.update(role);
}
}
@Override
public void saveRole(SysRole role,SysUser loginUser) {
String optUserName = loginUser.getUserName();
Date optDateTime = new Date();
int oid = role.getOid();
role.setOptUserName(optUserName);
role.setOptDateTime(optDateTime);
SysRole old = sysRoleDao.findOne(oid);
if(old==null){
role.setAddDateTime(optDateTime);
role.setAddUserName(optUserName);
sysRoleDao.save(role);
}else{
sysRoleDao.update(role);
}
}
@Override
public String findPage(SysUser user) {
// TODO Auto-generated method stub
List<SysRole> lrole = sysRoleDao.findRoleByID(user.getOid());
int roid = 100;
String roleName = "";
for (SysRole role : lrole) {
if(role.getOid()<roid){
roid = role.getOid();
roleName = role.getRoleName();
}
}
if("教师".equals(roleName)){
return "teacher/myCourse";
}else if("实验员".equals(roleName)){
return "labPeople/orderList";
}else if("学校管理员".equals(roleName)){
return "schoolAdmin/homePage";
}
return "disEduBur/homePage";
}
}
| UTF-8 | Java | 2,633 | java | RoleServiceImpl.java | Java | [
{
"context": "\n\t\tint oid = role.getOid();\n\t\trole.setOptUserName(optUserName);\n\t\trole.setOptDateTime(optDateTime); \n\t\tSysRole ",
"end": 1804,
"score": 0.9948292970657349,
"start": 1793,
"tag": "USERNAME",
"value": "optUserName"
},
{
"context": "tAddDateTime(optDateTime);\n\t\t\trole.setAddUserName(optUserName);\n\t\t\tsysRoleDao.save(role);\n\t\t}else{\n\t\t\tsysRoleDa",
"end": 1973,
"score": 0.9668725728988647,
"start": 1962,
"tag": "USERNAME",
"value": "optUserName"
}
]
| null | []
| package com.qm.sys.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qm.core.base.GridListData;
import com.qm.core.base.PageInfo;
import com.qm.core.util.DataListUtil;
import com.qm.core.util.DateUtil;
import com.qm.sys.dao.ISysRoleDao;
import com.qm.sys.domain.SysRole;
import com.qm.sys.domain.SysUser;
import com.qm.sys.query.SysRoleQuery;
import com.qm.sys.service.IRoleService;
@Service
public class RoleServiceImpl implements IRoleService {
@Autowired
private ISysRoleDao sysRoleDao;
@SuppressWarnings("unchecked")
@Override
public GridListData findAllRole(SysRoleQuery query, PageInfo pageInfo) throws Exception {
GridListData gridListData = sysRoleDao.findDataList1(query,pageInfo);
DataListUtil.formatDateList(gridListData.getRows(), new String[]{"optDateTime","addDateTime"});
return gridListData;
}
@Override
public SysRole findRoleById(int oid) {
return sysRoleDao.findOne(oid);
}
@Override
public List<SysRole> findRoleById(List<Integer> oidList) {
return sysRoleDao.findAll(oidList);
}
@Override
public List<SysRole> findLowRole(int oid) {
return sysRoleDao.findLowRole(oid);
}
@Override
public void changeDelFlg(SysUser sysUser, List<Integer> oidList, int delFlg) {
List<SysRole> roleList=sysRoleDao.findAll(oidList);
for(SysRole role : roleList){
role.setOptUserName(sysUser.getUserName());
role.setOptDateTime(DateUtil.getDate());
role.setDelFlg(delFlg);
sysRoleDao.update(role);
}
}
@Override
public void saveRole(SysRole role,SysUser loginUser) {
String optUserName = loginUser.getUserName();
Date optDateTime = new Date();
int oid = role.getOid();
role.setOptUserName(optUserName);
role.setOptDateTime(optDateTime);
SysRole old = sysRoleDao.findOne(oid);
if(old==null){
role.setAddDateTime(optDateTime);
role.setAddUserName(optUserName);
sysRoleDao.save(role);
}else{
sysRoleDao.update(role);
}
}
@Override
public String findPage(SysUser user) {
// TODO Auto-generated method stub
List<SysRole> lrole = sysRoleDao.findRoleByID(user.getOid());
int roid = 100;
String roleName = "";
for (SysRole role : lrole) {
if(role.getOid()<roid){
roid = role.getOid();
roleName = role.getRoleName();
}
}
if("教师".equals(roleName)){
return "teacher/myCourse";
}else if("实验员".equals(roleName)){
return "labPeople/orderList";
}else if("学校管理员".equals(roleName)){
return "schoolAdmin/homePage";
}
return "disEduBur/homePage";
}
}
| 2,633 | 0.740911 | 0.73938 | 98 | 25.663265 | 20.999487 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.928571 | false | false | 0 |
5a29ce8663e35ecc2880011053275590e397fed4 | 20,280,835,590,390 | b76f1a03b88d793787c179dc269be8b3f30243d1 | /src/othello/backend/OthelloGameFacade.java | 299c84dc5a3592bbd1d57c39ee9eb82914e3c91a | [
"Unlicense"
]
| permissive | Grupp2/GameBoard-API-Games | https://github.com/Grupp2/GameBoard-API-Games | 0694b958459001a5cc04bf84c273bdd2b7bc97e5 | 534b301d8381cacc9d8a67448f87a2e3aa4a9f6a | refs/heads/master | 2020-05-18T06:46:23.420000 | 2014-05-30T08:54:59 | 2014-05-30T08:54:59 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package othello.backend;
import game.api.GameState;
import game.impl.Board;
import game.impl.DieRollFactory;
import game.impl.Move;
import game.impl.Player;
import java.util.List;
public class OthelloGameFacade implements GameState{
private State state;
private GameActionsHandler gameActionsHandler;
public OthelloGameFacade(State state, GameActionsHandler gameActionsHandler){
this.state = state;
this.gameActionsHandler = gameActionsHandler;
}
public OthelloGameFacade(){
this.state = new State();
this.gameActionsHandler = new GameActionsHandler(this.state);
}
@Override
public List<Player> getPlayers() {
return state.getPlayers();
}
@Override
public Board getBoard() {
return state.getBoard();
}
@Override
public String getMessage() {
return state.getMessage();
}
@Override
public Player getLastPlayer() {
return state.getLastPlayer();
}
@Override
public Player getPlayerInTurn() {
return state.getCurrentPlayer();
}
@Override
public DieRollFactory getDieRollFactory() {
return null;
}
@Override
public Boolean hasEnded() {
return gameActionsHandler.hasEndedCheck();
}
@Override
public Player getWinner() {
return gameActionsHandler.calculateWinner();
}
@Override
public Boolean proposeMove(Move move) {
if(!gameActionsHandler.validateMove(move))
return false;
gameActionsHandler.executeMove(move);
return true;
}
@Override
public void reset() {
gameActionsHandler.reset();
}
public boolean canUndo(){
return state.getLastExecutedActionIndex() > -1;
}
public void undo(){
if(!canUndo())
state.setMessage("No moves to undo!");
else
gameActionsHandler.undo();
}
}
| UTF-8 | Java | 1,935 | java | OthelloGameFacade.java | Java | []
| null | []
| package othello.backend;
import game.api.GameState;
import game.impl.Board;
import game.impl.DieRollFactory;
import game.impl.Move;
import game.impl.Player;
import java.util.List;
public class OthelloGameFacade implements GameState{
private State state;
private GameActionsHandler gameActionsHandler;
public OthelloGameFacade(State state, GameActionsHandler gameActionsHandler){
this.state = state;
this.gameActionsHandler = gameActionsHandler;
}
public OthelloGameFacade(){
this.state = new State();
this.gameActionsHandler = new GameActionsHandler(this.state);
}
@Override
public List<Player> getPlayers() {
return state.getPlayers();
}
@Override
public Board getBoard() {
return state.getBoard();
}
@Override
public String getMessage() {
return state.getMessage();
}
@Override
public Player getLastPlayer() {
return state.getLastPlayer();
}
@Override
public Player getPlayerInTurn() {
return state.getCurrentPlayer();
}
@Override
public DieRollFactory getDieRollFactory() {
return null;
}
@Override
public Boolean hasEnded() {
return gameActionsHandler.hasEndedCheck();
}
@Override
public Player getWinner() {
return gameActionsHandler.calculateWinner();
}
@Override
public Boolean proposeMove(Move move) {
if(!gameActionsHandler.validateMove(move))
return false;
gameActionsHandler.executeMove(move);
return true;
}
@Override
public void reset() {
gameActionsHandler.reset();
}
public boolean canUndo(){
return state.getLastExecutedActionIndex() > -1;
}
public void undo(){
if(!canUndo())
state.setMessage("No moves to undo!");
else
gameActionsHandler.undo();
}
}
| 1,935 | 0.64031 | 0.639793 | 90 | 20.5 | 18.683475 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.322222 | false | false | 0 |
dd39a11497ede7a33ad6a4b1fc2d2bdaff0e8383 | 20,280,835,592,718 | da0fa3c9a7c36cae03f9948b806c282a5022920d | /src/main/java/br/gov/pr/guaira/portalturistico/repository/helper/TiposGastronomiasQueries.java | a468e2a7f7c72b58f64f63b8e6718ffeb7aec579 | []
| no_license | xhgrid/portalturistico | https://github.com/xhgrid/portalturistico | deb86e0b8a5f8ff7f3c73de955eee6405694743e | 363f8cf869a12f25c09c11449800f91d3a150ebf | refs/heads/master | 2022-11-12T18:19:58.924000 | 2020-07-09T20:28:59 | 2020-07-09T20:28:59 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.gov.pr.guaira.portalturistico.repository.helper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import br.gov.pr.guaira.portalturistico.model.Hospedagem;
import br.gov.pr.guaira.portalturistico.repository.filter.TipoGastronomiaFilter;
public interface TiposGastronomiasQueries {
public Page<Hospedagem> filtrar(TipoGastronomiaFilter tipoGastronomiaFilter, Pageable pageable);
}
| UTF-8 | Java | 441 | java | TiposGastronomiasQueries.java | Java | []
| null | []
| package br.gov.pr.guaira.portalturistico.repository.helper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import br.gov.pr.guaira.portalturistico.model.Hospedagem;
import br.gov.pr.guaira.portalturistico.repository.filter.TipoGastronomiaFilter;
public interface TiposGastronomiasQueries {
public Page<Hospedagem> filtrar(TipoGastronomiaFilter tipoGastronomiaFilter, Pageable pageable);
}
| 441 | 0.85034 | 0.85034 | 12 | 35.75 | 33.28194 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 0 |
f0321f4231f24786c0d2ce50e790e1a7d1d09a0a | 35,502,199,673,264 | 74df36761ea5bad388ee8b346f2a0e7ad9b98392 | /XiaoMiProject_SSM/src/main/java/com/two/service/ShopVersionServiceInter.java | 649859c7c92c871f2d389b8418dc67a994a52ec7 | []
| no_license | haobin404/NewProject | https://github.com/haobin404/NewProject | f50f0e896c2499cb8460e9a064b37f9bb0aba365 | be235c3e47fb3c99edc3f73d71ea96f6ab4be814 | refs/heads/master | 2022-12-25T19:53:27.730000 | 2020-01-12T09:26:45 | 2020-01-12T09:26:45 | 163,242,894 | 0 | 2 | null | false | 2022-12-16T10:32:05 | 2018-12-27T03:30:35 | 2020-01-12T09:26:47 | 2022-12-16T10:32:01 | 3,616 | 0 | 2 | 14 | HTML | false | false | package com.two.service;
import java.util.List;
import com.two.bean.ShopVersionBean;
public interface ShopVersionServiceInter {
abstract List<ShopVersionBean> getShopVersionId(int id);
}
| UTF-8 | Java | 203 | java | ShopVersionServiceInter.java | Java | []
| null | []
| package com.two.service;
import java.util.List;
import com.two.bean.ShopVersionBean;
public interface ShopVersionServiceInter {
abstract List<ShopVersionBean> getShopVersionId(int id);
}
| 203 | 0.763547 | 0.763547 | 9 | 20.555555 | 20.865234 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 0 |
13134e5a2cf5f4c711c23f9b728229fdabebcfb8 | 31,653,909,009,601 | cc612955bab98b9d08a2d6076c4e500fafd95b3d | /Lucky/lucky-boot/src/main/java/com/lucky/boot/startup/LuckyApplication.java | b824e0e716d0da811e3a93dd53c535808a515356 | []
| no_license | yuanqi99/lucky | https://github.com/yuanqi99/lucky | 5e4174eee129f2d26c54e356f301c8e315d09cd6 | 7d9ab0e660df5a86051c2bedbd46eab94dae24a2 | refs/heads/main | 2023-06-06T00:42:34.223000 | 2021-06-20T10:16:39 | 2021-06-20T10:16:39 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lucky.boot.startup;
import com.lucky.framework.AutoScanApplicationContext;
import com.lucky.framework.container.Module;
import com.lucky.framework.welcome.JackLamb;
import com.lucky.utils.base.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
/**
* @author fk
* @version 1.0
* @date 2020/12/3 0003 11:33
*/
public class LuckyApplication {
private static Logger log;
private static final RuntimeMXBean mxb = ManagementFactory.getRuntimeMXBean();
static {
System.setProperty("log4j.skipJansi","false");
}
public static void run(Class<?> applicationClass,String[] args){
EmbeddedTomcat tomcat = null;
long start;
try {
JackLamb.welcome();
start = System.currentTimeMillis();
log= LoggerFactory.getLogger(applicationClass);
String pid = mxb.getName().split("@")[0];
MDC.put("pid",pid);
String classpath= Assert.isNotNull(applicationClass.getClassLoader().getResource(""))
?applicationClass.getClassLoader().getResource("").getPath():applicationClass.getResource("").getPath();
log.info("Starting {} on localhost with PID {} ({} started by {} in {})"
,applicationClass.getSimpleName()
,pid
,classpath
,System.getProperty("user.name")
,System.getProperty("user.dir"));
tomcat=new EmbeddedTomcat(applicationClass,args);
}catch (Exception e){
throw new TomcatStartException(e);
}
tomcat.run();
long end = System.currentTimeMillis();
log.info("Started {} in {} seconds (JVM running for {})"
,applicationClass.getSimpleName()
,(end-start)/1000.0
,mxb.getUptime()/1000.0);
}
}
| UTF-8 | Java | 1,988 | java | LuckyApplication.java | Java | [
{
"context": "ava.lang.management.RuntimeMXBean;\n\n/**\n * @author fk\n * @version 1.0\n * @date 2020/12/3 0003 11:33\n */",
"end": 402,
"score": 0.9993808269500732,
"start": 400,
"tag": "USERNAME",
"value": "fk"
}
]
| null | []
| package com.lucky.boot.startup;
import com.lucky.framework.AutoScanApplicationContext;
import com.lucky.framework.container.Module;
import com.lucky.framework.welcome.JackLamb;
import com.lucky.utils.base.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
/**
* @author fk
* @version 1.0
* @date 2020/12/3 0003 11:33
*/
public class LuckyApplication {
private static Logger log;
private static final RuntimeMXBean mxb = ManagementFactory.getRuntimeMXBean();
static {
System.setProperty("log4j.skipJansi","false");
}
public static void run(Class<?> applicationClass,String[] args){
EmbeddedTomcat tomcat = null;
long start;
try {
JackLamb.welcome();
start = System.currentTimeMillis();
log= LoggerFactory.getLogger(applicationClass);
String pid = mxb.getName().split("@")[0];
MDC.put("pid",pid);
String classpath= Assert.isNotNull(applicationClass.getClassLoader().getResource(""))
?applicationClass.getClassLoader().getResource("").getPath():applicationClass.getResource("").getPath();
log.info("Starting {} on localhost with PID {} ({} started by {} in {})"
,applicationClass.getSimpleName()
,pid
,classpath
,System.getProperty("user.name")
,System.getProperty("user.dir"));
tomcat=new EmbeddedTomcat(applicationClass,args);
}catch (Exception e){
throw new TomcatStartException(e);
}
tomcat.run();
long end = System.currentTimeMillis();
log.info("Started {} in {} seconds (JVM running for {})"
,applicationClass.getSimpleName()
,(end-start)/1000.0
,mxb.getUptime()/1000.0);
}
}
| 1,988 | 0.619215 | 0.603119 | 56 | 34.482143 | 26.219534 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.696429 | false | false | 0 |
69d1e7f32399c90fcf386f292fbb793eb26ea595 | 60,129,559,427 | 06c271e25ad99089542fd45bfbd38200da1bdd4f | /DungeonKeep/src/logic/Keep.java | ea82b4a578b66e826f267d0b00ee8e436eb3bb70 | []
| no_license | cdanielgomes/LPOO | https://github.com/cdanielgomes/LPOO | 2aab0ab9c536c2949441f1052e1c47f830956de4 | 945194f334b83d169b49b1b71aaefa2f57068d00 | refs/heads/master | 2021-03-30T15:34:04.681000 | 2018-06-04T00:39:26 | 2018-06-04T00:39:26 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package logic;
import java.util.ArrayList;
/**
* Represents the second level of the game (Keep level)
*/
public class Keep extends GameMap{
private ArrayList<Ogre> hordOfOgres = new ArrayList<Ogre>();
/**
* Constructor of class Keep
* @param map map of the level
* @param numberofogres number of ogres in the level
* @param j exit doors in type ArrayList<Door>
*
*/
public Keep(char[][] map, int numberofogres) {
super(map);
ArrayList<Door> p = new ArrayList<Door>();
p.add(new Door(getCharc('I')));
this.door = p;
for (int i = 0 ; i < numberofogres; i++) {
hordOfOgres.add(new Ogre(getCharc('O')));
}
}
/**
* Makes the moves of all the ogres and hero
* @param heromove new move direction of hero
*/
@Override
public void autoMoves(char heromove) {
hero.calculateNextPos(this, heromove);
for (Ogre i : hordOfOgres)
i.calculateNextPos(this);
}
/**
* Checks if game is over
* @return true if game is over , false if not
*/
@Override
public boolean endOfGame() {
for (Ogre i : hordOfOgres) {
if(i.checkProximity(hero) && hero.isArmed()) {
i.setStun(true);
}
if (i.checkProximity(hero) && !i.isStun())
return true;
if (i.getWeapon().checkProximity(hero)) {
return true;
}
}
return false;
}
/**
* Deletes old Position of the ogres and hero
*/
@Override
void deleteOldPositions() {
deleteCell(hero);
for (Ogre i : hordOfOgres) {
deleteCell(i);
deleteCell(i.getWeapon());
}
}
/**
* Sets new Positions of the map Characters
*/
@Override
void setNewPositions() {
setMapSymbol(hero);
if(!hero.hasLever())
setMapSymbol(lever);
for (Ogre i : hordOfOgres) {
setMapSymbol(i);
setMapSymbol(i.getWeapon());
}
}
/**
* Returns the hord of ogres
* @return variable hordOfOgres of type ArrayList<Ogre>
*/
public ArrayList<Ogre> getHordOfOgres() {
return hordOfOgres;
}
}
| UTF-8 | Java | 1,927 | java | Keep.java | Java | []
| null | []
| package logic;
import java.util.ArrayList;
/**
* Represents the second level of the game (Keep level)
*/
public class Keep extends GameMap{
private ArrayList<Ogre> hordOfOgres = new ArrayList<Ogre>();
/**
* Constructor of class Keep
* @param map map of the level
* @param numberofogres number of ogres in the level
* @param j exit doors in type ArrayList<Door>
*
*/
public Keep(char[][] map, int numberofogres) {
super(map);
ArrayList<Door> p = new ArrayList<Door>();
p.add(new Door(getCharc('I')));
this.door = p;
for (int i = 0 ; i < numberofogres; i++) {
hordOfOgres.add(new Ogre(getCharc('O')));
}
}
/**
* Makes the moves of all the ogres and hero
* @param heromove new move direction of hero
*/
@Override
public void autoMoves(char heromove) {
hero.calculateNextPos(this, heromove);
for (Ogre i : hordOfOgres)
i.calculateNextPos(this);
}
/**
* Checks if game is over
* @return true if game is over , false if not
*/
@Override
public boolean endOfGame() {
for (Ogre i : hordOfOgres) {
if(i.checkProximity(hero) && hero.isArmed()) {
i.setStun(true);
}
if (i.checkProximity(hero) && !i.isStun())
return true;
if (i.getWeapon().checkProximity(hero)) {
return true;
}
}
return false;
}
/**
* Deletes old Position of the ogres and hero
*/
@Override
void deleteOldPositions() {
deleteCell(hero);
for (Ogre i : hordOfOgres) {
deleteCell(i);
deleteCell(i.getWeapon());
}
}
/**
* Sets new Positions of the map Characters
*/
@Override
void setNewPositions() {
setMapSymbol(hero);
if(!hero.hasLever())
setMapSymbol(lever);
for (Ogre i : hordOfOgres) {
setMapSymbol(i);
setMapSymbol(i.getWeapon());
}
}
/**
* Returns the hord of ogres
* @return variable hordOfOgres of type ArrayList<Ogre>
*/
public ArrayList<Ogre> getHordOfOgres() {
return hordOfOgres;
}
}
| 1,927 | 0.644006 | 0.643487 | 106 | 17.179245 | 17.752914 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.471698 | false | false | 0 |
c426dac2b82c5c97712ddce98107ff21bb6dc162 | 30,958,124,292,146 | 4887ef4145e96359d4924068d934b557e35b0b5b | /src/net/zkbc/p2p/fep/message/protocol/SubmitFinancialInfoRequest.java | 656132c6425bda8dfad978e7f4bfe0cc1a82ddf1 | [
"Apache-2.0"
]
| permissive | XinRan5312/ZCOriginal | https://github.com/XinRan5312/ZCOriginal | d0accc772c23aa2274666ac61d9d3ed3fe34937c | 5f9c6da92b722e88b706f968c4d22745290cdb5b | refs/heads/master | 2020-06-12T13:00:19.712000 | 2016-12-06T10:33:22 | 2016-12-06T10:33:22 | 75,717,745 | 1 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.zkbc.p2p.fep.message.protocol;
/**
* 提交用户个人财务信息.客户端请求
*
* @author 代码生成器v1.0
*
*/
public class SubmitFinancialInfoRequest extends RequestSupport {
private String bondstatus;
private String bondvalue;
private String carbrand;
private String carstatus;
private String carvalue;
private String housestatus;
private String housingarea;
private String monthlycarloan;
private String monthlyhouseloan;
private String monthlyincome;
private String payday;
private String paytype;
public SubmitFinancialInfoRequest() {
super();
setMessageId("submitFinancialInfo");
}
/**
* @return 证券情况
*/
public String getBondstatus() {
return bondstatus;
}
public void setBondstatus(String bondstatus) {
this.bondstatus = bondstatus;
}
/**
* @return 证券价值
*/
public String getBondvalue() {
return bondvalue;
}
public void setBondvalue(String bondvalue) {
this.bondvalue = bondvalue;
}
/**
* @return 车辆品牌
*/
public String getCarbrand() {
return carbrand;
}
public void setCarbrand(String carbrand) {
this.carbrand = carbrand;
}
/**
* @return 购车情况
*/
public String getCarstatus() {
return carstatus;
}
public void setCarstatus(String carstatus) {
this.carstatus = carstatus;
}
/**
* @return 汽车价值
*/
public String getCarvalue() {
return carvalue;
}
public void setCarvalue(String carvalue) {
this.carvalue = carvalue;
}
/**
* @return 住房情况
*/
public String getHousestatus() {
return housestatus;
}
public void setHousestatus(String housestatus) {
this.housestatus = housestatus;
}
/**
* @return 住房面积
*/
public String getHousingarea() {
return housingarea;
}
public void setHousingarea(String housingarea) {
this.housingarea = housingarea;
}
/**
* @return 车贷月供
*/
public String getMonthlycarloan() {
return monthlycarloan;
}
public void setMonthlycarloan(String monthlycarloan) {
this.monthlycarloan = monthlycarloan;
}
/**
* @return 房贷月供
*/
public String getMonthlyhouseloan() {
return monthlyhouseloan;
}
public void setMonthlyhouseloan(String monthlyhouseloan) {
this.monthlyhouseloan = monthlyhouseloan;
}
/**
* @return 月收入
*/
public String getMonthlyincome() {
return monthlyincome;
}
public void setMonthlyincome(String monthlyincome) {
this.monthlyincome = monthlyincome;
}
/**
* @return 发薪日期
*/
public String getPayday() {
return payday;
}
public void setPayday(String payday) {
this.payday = payday;
}
/**
* @return 发薪方式
*/
public String getPaytype() {
return paytype;
}
public void setPaytype(String paytype) {
this.paytype = paytype;
}
} | UTF-8 | Java | 2,773 | java | SubmitFinancialInfoRequest.java | Java | []
| null | []
| package net.zkbc.p2p.fep.message.protocol;
/**
* 提交用户个人财务信息.客户端请求
*
* @author 代码生成器v1.0
*
*/
public class SubmitFinancialInfoRequest extends RequestSupport {
private String bondstatus;
private String bondvalue;
private String carbrand;
private String carstatus;
private String carvalue;
private String housestatus;
private String housingarea;
private String monthlycarloan;
private String monthlyhouseloan;
private String monthlyincome;
private String payday;
private String paytype;
public SubmitFinancialInfoRequest() {
super();
setMessageId("submitFinancialInfo");
}
/**
* @return 证券情况
*/
public String getBondstatus() {
return bondstatus;
}
public void setBondstatus(String bondstatus) {
this.bondstatus = bondstatus;
}
/**
* @return 证券价值
*/
public String getBondvalue() {
return bondvalue;
}
public void setBondvalue(String bondvalue) {
this.bondvalue = bondvalue;
}
/**
* @return 车辆品牌
*/
public String getCarbrand() {
return carbrand;
}
public void setCarbrand(String carbrand) {
this.carbrand = carbrand;
}
/**
* @return 购车情况
*/
public String getCarstatus() {
return carstatus;
}
public void setCarstatus(String carstatus) {
this.carstatus = carstatus;
}
/**
* @return 汽车价值
*/
public String getCarvalue() {
return carvalue;
}
public void setCarvalue(String carvalue) {
this.carvalue = carvalue;
}
/**
* @return 住房情况
*/
public String getHousestatus() {
return housestatus;
}
public void setHousestatus(String housestatus) {
this.housestatus = housestatus;
}
/**
* @return 住房面积
*/
public String getHousingarea() {
return housingarea;
}
public void setHousingarea(String housingarea) {
this.housingarea = housingarea;
}
/**
* @return 车贷月供
*/
public String getMonthlycarloan() {
return monthlycarloan;
}
public void setMonthlycarloan(String monthlycarloan) {
this.monthlycarloan = monthlycarloan;
}
/**
* @return 房贷月供
*/
public String getMonthlyhouseloan() {
return monthlyhouseloan;
}
public void setMonthlyhouseloan(String monthlyhouseloan) {
this.monthlyhouseloan = monthlyhouseloan;
}
/**
* @return 月收入
*/
public String getMonthlyincome() {
return monthlyincome;
}
public void setMonthlyincome(String monthlyincome) {
this.monthlyincome = monthlyincome;
}
/**
* @return 发薪日期
*/
public String getPayday() {
return payday;
}
public void setPayday(String payday) {
this.payday = payday;
}
/**
* @return 发薪方式
*/
public String getPaytype() {
return paytype;
}
public void setPaytype(String paytype) {
this.paytype = paytype;
}
} | 2,773 | 0.699886 | 0.69875 | 160 | 15.5 | 15.935416 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.1875 | false | false | 0 |
0db3e0d5dcfc66c6a1de9482e57f585f6c3096d8 | 31,559,419,713,614 | 4566444ce9624ffd273e91cc8cc3160f9333ee75 | /src/kr/ac/kopo/day10/homwork/TriArea.java | 894b35e30ee57f9ba619ea91509710e81a8efa68 | []
| no_license | dhfkdlxm/study | https://github.com/dhfkdlxm/study | 88efdbcb4bb09f624c265700dd8aadc8e096200c | 4d96ebf17cfcb8122d29b96c8cdb767adedd95fa | refs/heads/master | 2023-05-06T22:48:38.117000 | 2021-05-30T11:18:36 | 2021-05-30T11:18:36 | 344,305,644 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kr.ac.kopo.day10.homwork;
public class TriArea extends AreaCal {
public TriArea() {
pntResult();
}
@Override
public void pntResult() {
int hor = super.ranNum();
int ver = super.ranNum();
System.out.println("가로 "+hor+", 높이 "+ver+"의 삼각형 면적은"+ (hor*ver/2)+" 입니다." );
}
}
| UTF-8 | Java | 321 | java | TriArea.java | Java | []
| null | []
| package kr.ac.kopo.day10.homwork;
public class TriArea extends AreaCal {
public TriArea() {
pntResult();
}
@Override
public void pntResult() {
int hor = super.ranNum();
int ver = super.ranNum();
System.out.println("가로 "+hor+", 높이 "+ver+"의 삼각형 면적은"+ (hor*ver/2)+" 입니다." );
}
}
| 321 | 0.631399 | 0.62116 | 15 | 18.533333 | 20.438091 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.333333 | false | false | 0 |
cbaac0cbb3df4754d865ecd568a574084f940889 | 12,017,318,507,420 | b50b10759c470b1f56ff04aee5e913aede3d40e6 | /src/main/java/org/scraelos/esofurnituremp/model/IngredientCount.java | 92a573c4460085dc02e352c56c9d4b28e1e98fe5 | []
| no_license | Scraelos/EsoFurnitureMarketplace | https://github.com/Scraelos/EsoFurnitureMarketplace | 4417f39f518a7084300a66ad6ce5308fe61527d1 | 16a3eea280820d9da46dcec23b319df404999595 | refs/heads/master | 2023-07-04T18:58:48.865000 | 2023-06-26T14:25:58 | 2023-06-26T14:25:58 | 82,163,349 | 0 | 0 | null | false | 2023-04-14T17:29:46 | 2017-02-16T09:29:32 | 2021-12-14T14:52:01 | 2023-04-14T17:29:44 | 248 | 0 | 0 | 3 | Java | false | false | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.scraelos.esofurnituremp.model;
/**
*
* @author guest
*/
public class IngredientCount {
private Ingredient ingredient;
private int count = 0;
public Ingredient getIngredient() {
return ingredient;
}
public void setIngredient(Ingredient ingredient) {
this.ingredient = ingredient;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public void add(int add) {
count = count + add;
}
}
| UTF-8 | Java | 725 | java | IngredientCount.java | Java | [
{
"context": ".scraelos.esofurnituremp.model;\n\n/**\n *\n * @author guest\n */\npublic class IngredientCount {\n\n private I",
"end": 252,
"score": 0.995243489742279,
"start": 247,
"tag": "USERNAME",
"value": "guest"
}
]
| null | []
| /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.scraelos.esofurnituremp.model;
/**
*
* @author guest
*/
public class IngredientCount {
private Ingredient ingredient;
private int count = 0;
public Ingredient getIngredient() {
return ingredient;
}
public void setIngredient(Ingredient ingredient) {
this.ingredient = ingredient;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public void add(int add) {
count = count + add;
}
}
| 725 | 0.642759 | 0.641379 | 37 | 18.594595 | 19.840527 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.297297 | false | false | 0 |
aad47cb5091e1748e8addfb6d7c8a6f15489fef1 | 32,117,765,469,185 | 45711008d45b606673533d625ca6fc659100c315 | /orm-learn/src/main/java/com/cognizant/ormlearn/model/AttemptQuestion.java | 476377098982f1b95c54677e9da959781b039e6d | []
| no_license | DeepthaGiridharan/Spring-Data-JPA | https://github.com/DeepthaGiridharan/Spring-Data-JPA | f7299055c749bcc9264011f7dc78f31467decb64 | ab534884510d520195f38a87148a3f083620e419 | refs/heads/main | 2023-02-23T22:45:31.840000 | 2021-02-04T07:20:00 | 2021-02-04T07:20:00 | 335,605,036 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cognizant.ormlearn.model;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="attempt_question")
public class AttemptQuestion {
@Id
@Column(name="aq_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@ManyToOne
@JoinColumn(name="aq_at_id")
private Attempt attempt;
@ManyToOne
@JoinColumn(name="aq_qt_id")
private Questions questions;
@OneToMany(mappedBy = "attemptQuestion", fetch = FetchType.EAGER)
private Set<AttemptOption> attemptOptionList;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Attempt getAttempt() {
return attempt;
}
public void setAttempt(Attempt attempt) {
this.attempt = attempt;
}
public Questions getQuestions() {
return questions;
}
public void setQuestions(Questions questions) {
this.questions = questions;
}
public Set<AttemptOption> getAttemptOptionList() {
return attemptOptionList;
}
public void setAttemptOptionList(Set<AttemptOption> attemptOptionList) {
this.attemptOptionList = attemptOptionList;
}
}
| UTF-8 | Java | 1,457 | java | AttemptQuestion.java | Java | []
| null | []
| package com.cognizant.ormlearn.model;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="attempt_question")
public class AttemptQuestion {
@Id
@Column(name="aq_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@ManyToOne
@JoinColumn(name="aq_at_id")
private Attempt attempt;
@ManyToOne
@JoinColumn(name="aq_qt_id")
private Questions questions;
@OneToMany(mappedBy = "attemptQuestion", fetch = FetchType.EAGER)
private Set<AttemptOption> attemptOptionList;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Attempt getAttempt() {
return attempt;
}
public void setAttempt(Attempt attempt) {
this.attempt = attempt;
}
public Questions getQuestions() {
return questions;
}
public void setQuestions(Questions questions) {
this.questions = questions;
}
public Set<AttemptOption> getAttemptOptionList() {
return attemptOptionList;
}
public void setAttemptOptionList(Set<AttemptOption> attemptOptionList) {
this.attemptOptionList = attemptOptionList;
}
}
| 1,457 | 0.743995 | 0.743995 | 57 | 23.561403 | 17.727982 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.210526 | false | false | 0 |
d407d80aae27ef9ae7d72aa0b7ac52e25929f634 | 29,935,922,079,573 | ce9243c7f478b8d41a0c2309aa3d5cf48b20b173 | /src/main/java/ofedorova/common/services/IntegrationServiceByXml.java | ae6bb7d27d2a5909d22868d5672e0a3925f643b7 | []
| no_license | OlgaFedorova/spring-jms-jpa-jta | https://github.com/OlgaFedorova/spring-jms-jpa-jta | 2ad3fa3b3f6548094d85ba4a4752cfc011157cd5 | d4b93bcb44ab322cab3d166e90047e2719c90554 | refs/heads/master | 2021-09-08T08:39:20.876000 | 2018-03-08T16:49:28 | 2018-03-08T16:49:28 | 124,420,584 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ofedorova.common.services;
import lombok.extern.slf4j.Slf4j;
import ofedorova.db.dao.QueueMessageOutDao;
import ofedorova.db.entity.QueueMessageOut;
import ofedorova.jms.services.SendlerToMq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Slf4j
public class IntegrationServiceByXml implements IntegrationService {
@Autowired
private SendlerToMq sendlerToMq;
@Autowired
private QueueMessageOutDao queueMessageOutDao;
@Transactional(rollbackFor = Throwable.class)
@Override
public void formMessageAndSendToMQ() throws Exception {
log.debug("Start: Form and send message to MQ.");
String text = "Hello! This is test-message!";
QueueMessageOut queueMessageOut = new QueueMessageOut();
queueMessageOut.setMessage(text);
this.queueMessageOutDao.add(queueMessageOut);
this.sendlerToMq.sendMessage(text);
log.debug("End: Form and send message to MQ.");
}
}
| UTF-8 | Java | 1,092 | java | IntegrationServiceByXml.java | Java | []
| null | []
| package ofedorova.common.services;
import lombok.extern.slf4j.Slf4j;
import ofedorova.db.dao.QueueMessageOutDao;
import ofedorova.db.entity.QueueMessageOut;
import ofedorova.jms.services.SendlerToMq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Slf4j
public class IntegrationServiceByXml implements IntegrationService {
@Autowired
private SendlerToMq sendlerToMq;
@Autowired
private QueueMessageOutDao queueMessageOutDao;
@Transactional(rollbackFor = Throwable.class)
@Override
public void formMessageAndSendToMQ() throws Exception {
log.debug("Start: Form and send message to MQ.");
String text = "Hello! This is test-message!";
QueueMessageOut queueMessageOut = new QueueMessageOut();
queueMessageOut.setMessage(text);
this.queueMessageOutDao.add(queueMessageOut);
this.sendlerToMq.sendMessage(text);
log.debug("End: Form and send message to MQ.");
}
}
| 1,092 | 0.759158 | 0.75641 | 36 | 29.333334 | 24.320772 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.472222 | false | false | 0 |
332ca595235a9e9695c2b8fcc732ffdab7a1b9bb | 28,750,511,148,516 | 34f12fb97f56b3435695670b8ee880adc4a2fbdb | /odk/src/main/java/de/illilli/opengis/odk/bo/EinwohnerNachAltersgruppenSchuelerDao.java | de98190960b516811e6eeec5463664c56048d41d | []
| no_license | weberius/osm | https://github.com/weberius/osm | 8125c5c30d216d2303e3361626ad0462d075d56f | c310f67e6b441c397357677cdc2775a630227a32 | refs/heads/master | 2016-09-05T10:47:18.255000 | 2015-10-19T04:56:42 | 2015-10-19T04:56:42 | 27,240,610 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package de.illilli.opengis.odk.bo;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import de.illilli.opengis.odk.bo.csv.EinwohnerNachAltersgruppen;
public class EinwohnerNachAltersgruppenSchuelerDao {
private List<EinwohnerNachAltersgruppenBo> boList;
public EinwohnerNachAltersgruppenSchuelerDao(
EinwohnerNachAltersgruppen einwohner) {
boList = new ArrayList<EinwohnerNachAltersgruppenBo>();
int a0_5 = einwohner.getA0_2() + einwohner.getA3_5();
Double quotient = new Double(a0_5)
/ new Double(einwohner.getEinwohnerInsgesamt());
String percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
String label = EinwohnerNachAltersgruppen.Head.a0_5.key() + ": "
+ percent;
EinwohnerNachAltersgruppenBo bo = new EinwohnerNachAltersgruppenBo(
a0_5, EinwohnerNachAltersgruppen.Head.a0_5.color(),
EinwohnerNachAltersgruppen.Head.a0_5.highlight(), label);
boList.add(bo);
int a6_17 = einwohner.getA6_14() + einwohner.getA15_17();
quotient = new Double(a6_17)
/ new Double(einwohner.getEinwohnerInsgesamt());
percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
label = EinwohnerNachAltersgruppen.Head.a6_17.key() + ": " + percent;
bo = new EinwohnerNachAltersgruppenBo(a6_17,
EinwohnerNachAltersgruppen.Head.a6_17.color(),
EinwohnerNachAltersgruppen.Head.a6_17.highlight(), label);
boList.add(bo);
int a18_65 = einwohner.getA18_20() + einwohner.getA21_34()
+ einwohner.getA35_59() + einwohner.getA60_64();
quotient = new Double(a18_65)
/ new Double(einwohner.getEinwohnerInsgesamt());
percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
label = EinwohnerNachAltersgruppen.Head.a18_65.key() + ": " + percent;
bo = new EinwohnerNachAltersgruppenBo(a18_65,
EinwohnerNachAltersgruppen.Head.a18_65.color(),
EinwohnerNachAltersgruppen.Head.a18_65.highlight(), label);
boList.add(bo);
int a65undAelter = einwohner.getA65_74() + einwohner.getA75_79()
+ einwohner.getA80undAelter();
quotient = new Double(a65undAelter)
/ new Double(einwohner.getEinwohnerInsgesamt());
percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
label = EinwohnerNachAltersgruppen.Head.a65undAelter.key() + ": "
+ percent;
bo = new EinwohnerNachAltersgruppenBo(a65undAelter,
EinwohnerNachAltersgruppen.Head.a65undAelter.color(),
EinwohnerNachAltersgruppen.Head.a65undAelter.highlight(), label);
boList.add(bo);
}
public List<EinwohnerNachAltersgruppenBo> getBoList() {
return boList;
}
}
| UTF-8 | Java | 2,648 | java | EinwohnerNachAltersgruppenSchuelerDao.java | Java | []
| null | []
| package de.illilli.opengis.odk.bo;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import de.illilli.opengis.odk.bo.csv.EinwohnerNachAltersgruppen;
public class EinwohnerNachAltersgruppenSchuelerDao {
private List<EinwohnerNachAltersgruppenBo> boList;
public EinwohnerNachAltersgruppenSchuelerDao(
EinwohnerNachAltersgruppen einwohner) {
boList = new ArrayList<EinwohnerNachAltersgruppenBo>();
int a0_5 = einwohner.getA0_2() + einwohner.getA3_5();
Double quotient = new Double(a0_5)
/ new Double(einwohner.getEinwohnerInsgesamt());
String percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
String label = EinwohnerNachAltersgruppen.Head.a0_5.key() + ": "
+ percent;
EinwohnerNachAltersgruppenBo bo = new EinwohnerNachAltersgruppenBo(
a0_5, EinwohnerNachAltersgruppen.Head.a0_5.color(),
EinwohnerNachAltersgruppen.Head.a0_5.highlight(), label);
boList.add(bo);
int a6_17 = einwohner.getA6_14() + einwohner.getA15_17();
quotient = new Double(a6_17)
/ new Double(einwohner.getEinwohnerInsgesamt());
percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
label = EinwohnerNachAltersgruppen.Head.a6_17.key() + ": " + percent;
bo = new EinwohnerNachAltersgruppenBo(a6_17,
EinwohnerNachAltersgruppen.Head.a6_17.color(),
EinwohnerNachAltersgruppen.Head.a6_17.highlight(), label);
boList.add(bo);
int a18_65 = einwohner.getA18_20() + einwohner.getA21_34()
+ einwohner.getA35_59() + einwohner.getA60_64();
quotient = new Double(a18_65)
/ new Double(einwohner.getEinwohnerInsgesamt());
percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
label = EinwohnerNachAltersgruppen.Head.a18_65.key() + ": " + percent;
bo = new EinwohnerNachAltersgruppenBo(a18_65,
EinwohnerNachAltersgruppen.Head.a18_65.color(),
EinwohnerNachAltersgruppen.Head.a18_65.highlight(), label);
boList.add(bo);
int a65undAelter = einwohner.getA65_74() + einwohner.getA75_79()
+ einwohner.getA80undAelter();
quotient = new Double(a65undAelter)
/ new Double(einwohner.getEinwohnerInsgesamt());
percent = NumberFormat.getPercentInstance(Locale.GERMAN).format(
quotient);
label = EinwohnerNachAltersgruppen.Head.a65undAelter.key() + ": "
+ percent;
bo = new EinwohnerNachAltersgruppenBo(a65undAelter,
EinwohnerNachAltersgruppen.Head.a65undAelter.color(),
EinwohnerNachAltersgruppen.Head.a65undAelter.highlight(), label);
boList.add(bo);
}
public List<EinwohnerNachAltersgruppenBo> getBoList() {
return boList;
}
}
| 2,648 | 0.75 | 0.711103 | 72 | 35.777779 | 24.899923 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.569444 | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.