- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我陷入了一个主要问题,我有一个名为 HashMap 的映射,例如
{19434={ballsdone=184, ballsdone2=343, comment=Lancs trail by 83 runs, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-7074Lancashire.png, flag2=Img-2216Yorkshire.png, id=19434, id1=8, inning=2, market_Id=1.145815859, match_number=County Div 1, matchid=19434, order=0, rate=, rate2=, rate_team=, score=109, score2=192, series_id=64, series_name=County Championship Division One 2018, status=1, t1=LANCS, t2=YORKS, target=206, team1=Lancashire, team2=Yorkshire, title=LANCS vs YORKS, total_balls=540, type=0, userid=, venue=At - Old Trafford, Manchester, wicket=10, wicket2=10},
19435={ballsdone=324, ballsdone2=252, comment=Sur lead by 11 runs, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-6552Nottinghamshire.png, flag2=Img-8581Surrey.png, id=19435, id1=9, inning=2, market_Id=1.145815859, match_number=County Div 1, matchid=19435, order=0, rate=, rate2=, rate_team=, score=210, score2=221, series_id=64, series_name=County Championship Division One 2018, status=1, t1=NOTTS, t2=SUR, target=563, team1=Nottinghamshire, team2=Surrey, title=NOTTS vs SUR, total_balls=540, type=0, userid=, venue=At - Trent Bridge, Nottingham, wicket=10, wicket2=1},
19436={ballsdone=576, ballsdone2=0, comment=Day 1: Stumps, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-7101Somerset.png, flag2=, id=19436, id1=10, inning=1, market_Id=1.145815859, match_number=County Div 1, matchid=19436, order=0, rate=, rate2=, rate_team=, score=324, score2=0, series_id=64, series_name=County Championship Division One 2018, status=1, t1=SOM, t2=, target=, team1=Somerset, team2=, title=WORCS vs SOM, total_balls=540, type=0, userid=, venue=At - New Road, Worcester, wicket=9, wicket2=0},
19522={ballsdone=325, ballsdone2=246, comment=Warks trail by 84 runs, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-1634Middlesex.png, flag2=Img-5585Warwickshire.png, id=19522, id1=11, inning=2, market_Id=1.145815859, match_number=County Div 2, matchid=19522, order=0, rate=, rate2=, rate_team=, score=236, score2=152, series_id=65, series_name=County Championship Division Two 2018, status=1, t1=MDX, t2=WARKS, target=182, team1=Middlesex, team2=Warwickshire, title=MDX vs WARKS, total_balls=540, type=0, userid=, venue=At - Lord's, London, wicket=10, wicket2=4},
19523={ballsdone=227, ballsdone2=331, comment=LEIC lead by 45 runs, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-7731Kent.png, flag2=Img-5506Leicestershire.png, id=19523, id1=12, inning=2, market_Id=1.145815859, match_number=County Div 2, matchid=19523, order=0, rate=, rate2=, rate_team=, score=104, score2=149, series_id=65, series_name=County Championship Division Two 2018, status=1, t1=Kent , t2=LEIC, target=415, team1=Kent, team2=Leicestershire, title=KENT vs LEIC, total_balls=540, type=0, userid=, venue=At - St Lawrence Ground, Canterbury, wicket=10, wicket2=6},
19524={ballsdone=574, ballsdone2=0, comment=Day 1: Stumps, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-7692Gloucestershire.png, flag2=Img-9899Durham.png, id=19524, id1=13, inning=1, market_Id=1.145815859, match_number=County Div 2, matchid=19524, order=0, rate=, rate2=, rate_team=, score=315, score2=0, series_id=65, series_name=County Championship Division Two 2018, status=1, t1=GLOUCS, t2=DUR, target=, team1=Gloucestershire, team2=Durham, title=GLOUCS vs DUR, total_balls=540, type=0, userid=, venue=At - College Ground, Cheltenham, wicket=7, wicket2=0},
19525={ballsdone=449, ballsdone2=114, comment=NOR trail by 186 runs, date=22 July 2018 , 03:30 PM, event_Id=, flag1=Img-9861Derbyshire.png, flag2=Img-5442Northamptonshire.png, id=19525, id1=14, inning=2, market_Id=1.145815859, match_number=County Div 2, matchid=19525, order=0, rate=, rate2=, rate_team=, score=260, score2=74, series_id=65, series_name=County Championship Division Two 2018, status=1, t1=DERBY, t2=NOR, target=457, team1=Derbyshire, team2=Northamptonshire, title=DERBY vs NOR, total_balls=540, type=0, userid=, venue=At - Queen's Park, Chesterfield, wicket=10, wicket2=3},
19526={ballsdone=571, ballsdone2=0, comment=Day 1: Stumps, date=22 July 2018 , 06:30 PM, event_Id=, flag1=Img-2844Sussex.png, flag2=Img-25784_Glamorgan.png, id=19526, id1=15, inning=1, market_Id=1.145815859, match_number=County Div 2, matchid=19526, order=0, rate=, rate2=, rate_team=, score=327, score2=0, series_id=65, series_name=County Championship Division Two 2018, status=1, t1=SUS, t2=GLAM, target=, team1=Sussex, team2=Glamorgan, title=SUS vs GLAM, total_balls=540, type=0, userid=, venue=At - County Ground, Hove, wicket=10, wicket2=0},
20165={ballsdone=486, ballsdone2=455, comment=RSA need 244 runs, date=20 July 2018 , 10:00 AM, event_Id=, flag1=IMG-0-201711220843449293.png, flag2=IMG-0-201712281139133480.png, id=20165, id1=2, inning=2, market_Id=1.145815859, match_number=2nd Test, matchid=20165, order=0, rate=, rate2=, rate_team=, score=275, score2=246, series_id=90, series_name=South Africa tour of Sri Lanka 2018, t1=SL, t2=RSA, target=303, team1=Sri Lanka, team2=South Africa, title=SL vs RSA, total_balls=540, type=0, userid=, venue=At - Sinhalese Sports Club, Colombo, wicket=5, wicket2=7},
20481={ballsdone=0, ballsdone2=0, comment=Starts in 7 hrs 00 min, date=23 July 2018 , 07:15 PM, event_Id=, flag1=, flag2=, id=20481, id1=20, inning=1, market_Id=1.145815859, match_number=13th Match, matchid=20481, order=0, rate=, rate2=, rate_team=, score=0, score2=0, series_id=93, series_name=Tamil Nadu Premier League 2018, status=1, t1=LKK, t2=, target=, team1=Lyca Kovai Kings, team2=, title=RTW vs LKK, total_balls=120, type=0, userid=, venue=At - NPR College Ground, Dindigul, wicket=0, wicket2=0}}
我还有一个 bean 类,我也想将 hask 映射值设置到 bean 数组列表中,但我不明白我该怎么做,我已经尝试过这样的
我有带有以下对象的 bean 类
public class CFLivematch {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private String id;
@Column(name="comment")
String comment;
@Column(name="date")
String date;
@Column(name="flag1")
String flag1;
@Column(name="flag2")
String flag2;
@Column(name="inning")
String inning;
@Column(name="matchnumber")
String matchnumber;
@Column(name="t1")
String t1;
@Column(name="t2")
String t2;
@Column(name="team1")
String team1;
@Column(name="team2")
String team2;
@Column(name="totalballs")
String totalballs;
@Column(name="venue")
String venue;
@Column(name="wicket")
String wicket;
@Column(name="wicket2")
String wicket2;
@Column(name="score")
String score;
@Column(name="score2")
String score2;
@Column(name="target")
String target;
@Column(name="ballsdone2")
String ballsdone2;
@Column(name="ballsdone")
String ballsdone;
@Column(name="total_balls")
String total_balls;
@Column(name="rate")
String rate;
@Column(name="rate2")
String rate2;
@Column(name="title")
String title;
@Column(name="match_number")
String match_number;
@Column(name="series_id")
String series_id;
@Column(name="series_name")
String series_name;
@Column(name="order")
String order;
@Column(name="orstatusder")
String status;
@Column(name="type")
String type;
@Column(name="rate_team")
String rate_team;
@Column(name="market_Id")
String market_Id;
@Column(name="event_Id")
String event_Id;
@Column(name="addedtofirebase")
String addedtofirebase;
@Column(name="matchid")
String matchid;
@Transient
String id1;
@Transient
String userid;
}
我想设置那个 bean 对象
我有ArrayList<CFLivematch>
你们能帮我解决这个问题吗?
谢谢
最佳答案
定义您自己的输入解析器,它将字符串格式的输入映射转换为 java 对象类型。
另一种方法是,如果可能的话,以已知格式获取输入数据,例如json,并使用 json 库转换为您的对象。
关于java - HashMap值发送到bean类java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51473739/
有什么区别 和 您能解释一下这两者之间有什么区别吗? 最佳答案 它是一个 XML 命名空间,用于分隔可能存在冲突的元素名称,因此没有真正的区别。 XML Namespaces 关于java -
我刚刚浏览了两个 Web 应用程序,在两个项目的“applicationContext.xml”文件中都有一个标记 ... 另一个是 ... 谁能给我解释一下有什么区别吗? 最佳答案 没有语
我一直在尝试了解 WebSphere Commerce 中的 Java bean,但我真的很困惑。请帮帮我。我需要知道: What is the difference between EntityBe
自从我们更新到 grails 2.0.1(从 2.0.0 开始)以来,通过 bean 字段显示的所有 bean 都错误地显示为“withBean”字段的第一个属性。在我下面发布的示例中,所有 [fir
我有一个 bean,我将另一个 beanlist 放入其中,并且我想访问该内部 bean。 我的第一个 Bean 是: public class FirstDTO { private String F
我正在尝试将 CSS 和 JS 添加到 spring MVC 项目中的 JSP 页面,以便我在 dispatcher-servlet.xml 中包含了 js/css 文件夹的引用,如下所示:
当我将请求传递给 RestController 时,出现以下错误。 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreExcept
我看到很多示例将 bean 标记为实体 bean (@Entity) 和命名 bean (CDI),以避免创建 2 个类(托管 bean 和实体 bean)并利用 Bean 验证以便可以执行验证在客户
在我的理解中, session 总是意味着有状态。考虑 servlet session 对象, 想想 cookie。如果 session 是无状态的,我认为我们根本不需要 session 。 在jee
我完全是Spring框架的初学者。我当时正在玩一个创建对象实例的示例。因此需要您的帮助! 看看这个例子: MainApp.java: import org.springframework.contex
这个问题在这里已经有了答案: What is a JavaBean exactly? (23 个回答) 关闭 7 年前。 我已经阅读了有关 EJB、Java Beans 的内容,但是我仍然对“bea
我刚开始使用 Spring-Framework,实际上我正在使用 spring-boot 库。我有以下问题: 我知道在 @Configuration 类中使用 @Bean 注册的 bean 默认是单例
我对下面提到的场景中使用Spring Framework时会创建的实例数量有疑问: bean配置是这样的 or 默认情况下,bean "a"有 singleton scope .所以
在我的 Spring-Module.xml 中,我有两个 bean: ... ... 我像这样实例化我的类: Applicat
@Autowired private Map departments; 我的 spring 配置文件 只要使用 @Autowired 需要日期,它就可以正常工作 同样, 如何使用没有属性
我已经为 ComboBox 设置了 ContainerDataSource this.comboBox.setContainerDataSource(container)。这个容器是一个 BeanIt
为了支持流畅的编程风格,我最近修改了我们的 Java Beans setter 方法以返回 Bean 类。但是现在 Java Beans Activation Framework (rel 1.1)
有人可以告诉我在我的 ApplicationContext 中我必须使用 beans:bean 而不是 bean 的什么以及如何修复它。
我有如下配置: batch:job id="reconciliationJob" job-repository="jobRepository" restartable="true" 在应用程序上下文启
我已经为 Test_flow 创建了简单的测试套件,但是当我尝试运行该流程时出现错误。 java.lang.RuntimeException: org.mule.api.config.Configur
我是一名优秀的程序员,十分优秀!